/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('oceanbasepro', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model DataExtraInfoSubCondsValue = {
  tenantName?: string(name='TenantName', example='tenant_name'),
  database?: string(name='Database', example='db_name'),
  destDatabase?: string(name='DestDatabase', example='dest_db'),
  tableName?: string(name='TableName', example='table_name'),
  destName?: string(name='DestName', example='dest_name'),
  whereClause?: string(name='WhereClause', example='id>1'),
  filterColumns?: [ string ](name='FilterColumns'),
  shardColumns?: [ string ](name='ShardColumns'),
  logicTableId?: string(name='LogicTableId', example='null'),
  sourceEndpointId?: string(name='SourceEndpointId', example='null'),
  sourceClientId?: string(name='SourceClientId', example='null'),
}

model DataExtraInfoSubDbsValue = {
  clusterName?: string(name='ClusterName', example='cluster_name'),
  tenantName?: string(name='TenantName', example='tenant_name'),
  databaseId?: string(name='DatabaseId', example='null'),
  databaseName?: string(name='DatabaseName', example='db_name'),
  mappingDatabaseName?: string(name='MappingDatabaseName', example='mapped_db'),
  sourceClientId?: string(name='SourceClientId', example='null'),
  tables?: [ 
    {
      tableId?: string(name='TableId', example='fexg***'),
      database?: string(name='Database', example='db_name'),
      tableName?: string(name='TableName', example='table_name'),
      mappingTableName?: string(name='MappingTableName', example='mapped_table'),
      instance?: string(name='Instance', example='g_i4kat***'),
      columns?: [ 
        {
          columnName?: string(name='ColumnName', example='null'),
          position?: int32(name='Position', example='null'),
          columnType?: string(name='ColumnType', example='null'),
          recordFieldType?: string(name='RecordFieldType', example='null'),
          rawColumnType?: string(name='RawColumnType', example='null'),
          columnKey?: string(name='ColumnKey', example='null'),
          nullable?: boolean(name='Nullable', example='true'),
          defaultValue?: string(name='DefaultValue', example='null'),
          dataLength?: long(name='DataLength', example='null'),
          dataPrecision?: int32(name='DataPrecision', example='64'),
          dataScale?: int32(name='DataScale', example='null'),
          encoding?: string(name='Encoding', example='utf8'),
          columnComment?: string(name='ColumnComment', example='comments'),
          isGenerateField?: boolean(name='IsGenerateField', example='false'),
        }
      ](name='Columns'),
    }
  ](name='Tables'),
}

model BatchKillProcessListRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  sessionList?: string(name='SessionList', description='The list of sessions to close.

This parameter is required.', example='[{"ProxySessId":"752113700739156671","SessionId":3221555062,"ServerIp":"10.***.**.***"}]'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t33h8y08k****'),
}

model BatchKillProcessListResponseBody = {
  data?: [ 
    {
      success?: boolean(name='Success', description='Indicates whether the calling is successful.', example='true'),
    }
  ](name='Data', description='The array of the return result.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model BatchKillProcessListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchKillProcessListResponseBody(name='body'),
}

/**
 * @summary You can call this operation to close sessions in batches. Please note that this operation is executed asynchronously. After calling this operation, you need to verify it by calling DescribeProcessStatsComposition.
 *
 * @param request BatchKillProcessListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchKillProcessListResponse
 */
async function batchKillProcessListWithOptions(request: BatchKillProcessListRequest, runtime: Util.RuntimeOptions): BatchKillProcessListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.sessionList)) {
    body['SessionList'] = request.sessionList;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BatchKillProcessList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to close sessions in batches. Please note that this operation is executed asynchronously. After calling this operation, you need to verify it by calling DescribeProcessStatsComposition.
 *
 * @param request BatchKillProcessListRequest
 * @return BatchKillProcessListResponse
 */
async function batchKillProcessList(request: BatchKillProcessListRequest): BatchKillProcessListResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchKillProcessListWithOptions(request, runtime);
}

model BatchKillSessionListRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  sessionList?: string(name='SessionList', description='The list of sessions, which is concatenated with commas.
>The session information is obtained from the result returned by the DescribeSessionList API.

This parameter is required.', example='342,354,343'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model BatchKillSessionListResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model BatchKillSessionListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchKillSessionListResponseBody(name='body'),
}

/**
 * @summary You can call this operation to close sessions between the ApsaraDB for OceanBase and the application in batches. Please note that this operation is executed asynchronously. After calling this operation, you need to verify it by calling DescribeSessionList.
 *
 * @param request BatchKillSessionListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchKillSessionListResponse
 */
async function batchKillSessionListWithOptions(request: BatchKillSessionListRequest, runtime: Util.RuntimeOptions): BatchKillSessionListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.sessionList)) {
    body['SessionList'] = request.sessionList;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BatchKillSessionList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to close sessions between the ApsaraDB for OceanBase and the application in batches. Please note that this operation is executed asynchronously. After calling this operation, you need to verify it by calling DescribeSessionList.
 *
 * @param request BatchKillSessionListRequest
 * @return BatchKillSessionListResponse
 */
async function batchKillSessionList(request: BatchKillSessionListRequest): BatchKillSessionListResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchKillSessionListWithOptions(request, runtime);
}

model CancelProjectModifyRecordRequest {
  id?: string(name='Id', description='This parameter is required.', example='344000005'),
}

model CancelProjectModifyRecordResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='30'),
  data?: any(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='200'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model CancelProjectModifyRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelProjectModifyRecordResponseBody(name='body'),
}

/**
 * @summary 根据记录id取消修改操作 （仅支持处于 PENDING 状态的修改记录）
 *
 * @param request CancelProjectModifyRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelProjectModifyRecordResponse
 */
async function cancelProjectModifyRecordWithOptions(request: CancelProjectModifyRecordRequest, runtime: Util.RuntimeOptions): CancelProjectModifyRecordResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CancelProjectModifyRecord',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据记录id取消修改操作 （仅支持处于 PENDING 状态的修改记录）
 *
 * @param request CancelProjectModifyRecordRequest
 * @return CancelProjectModifyRecordResponse
 */
async function cancelProjectModifyRecord(request: CancelProjectModifyRecordRequest): CancelProjectModifyRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelProjectModifyRecordWithOptions(request, runtime);
}

model CreateBackupSetDownloadLinkRequest {
  backupSetId?: string(name='BackupSetId', description='This parameter is required.', example='bak-6f****'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='i-bp67acfmxazb4p****'),
}

model CreateBackupSetDownloadLinkResponseBody = {
  downloadTaskId?: long(name='DownloadTaskId', example='10000***67'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model CreateBackupSetDownloadLinkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBackupSetDownloadLinkResponseBody(name='body'),
}

/**
 * @summary 创建备份任务下载链接
 *
 * @param request CreateBackupSetDownloadLinkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBackupSetDownloadLinkResponse
 */
async function createBackupSetDownloadLinkWithOptions(request: CreateBackupSetDownloadLinkRequest, runtime: Util.RuntimeOptions): CreateBackupSetDownloadLinkResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.backupSetId)) {
    body['BackupSetId'] = request.backupSetId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateBackupSetDownloadLink',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建备份任务下载链接
 *
 * @param request CreateBackupSetDownloadLinkRequest
 * @return CreateBackupSetDownloadLinkResponse
 */
async function createBackupSetDownloadLink(request: CreateBackupSetDownloadLinkRequest): CreateBackupSetDownloadLinkResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBackupSetDownloadLinkWithOptions(request, runtime);
}

model CreateDatabaseRequest {
  clientToken?: string(name='ClientToken', description='The name of the database.', example='123e4567-e89b-12d3-a456-426655440000'),
  collation?: string(name='Collation', description='The encoding standard of the database.
For more information, see the Charset field returned by the DescribeCharset operation.', example='utf8mb4_general_ci'),
  databaseName?: string(name='DatabaseName', description='Alibaba Cloud CLI

This parameter is required.', example='sms_pre'),
  description?: string(name='Description', description='The operation that you want to perform.   
Set the value to **CreateDatabase**.', example='this is a test database'),
  encoding?: string(name='Encoding', description='The ID of the tenant.

This parameter is required.', example='utf8mb4'),
  instanceId?: string(name='InstanceId', description='The collation.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The name of the database.   
You cannot use reserved keywords, such as test and mysql.

This parameter is required.', example='ob2mr3oae0****'),
}

model CreateDatabaseResponseBody = {
  databaseName?: string(name='DatabaseName', description='CreateDatabase', example='sms_pre'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model CreateDatabaseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDatabaseResponseBody(name='body'),
}

/**
 * @summary The request ID.
 *
 * @param request CreateDatabaseRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDatabaseResponse
 */
async function createDatabaseWithOptions(request: CreateDatabaseRequest, runtime: Util.RuntimeOptions): CreateDatabaseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.collation)) {
    body['Collation'] = request.collation;
  }
  if (!Util.isUnset(request.databaseName)) {
    body['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.encoding)) {
    body['Encoding'] = request.encoding;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDatabase',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The request ID.
 *
 * @param request CreateDatabaseRequest
 * @return CreateDatabaseResponse
 */
async function createDatabase(request: CreateDatabaseRequest): CreateDatabaseResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDatabaseWithOptions(request, runtime);
}

model CreateInstanceRequest {
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable automatic renewal.   
This parameter is valid only when the ChargeType parameter is set to PrePaid. Valid values: 
- true: enables automatic renewal for the instance.   
- false: disables automatic renewal for the instance. This is the default value.', example='true'),
  autoRenewPeriod?: long(name='AutoRenewPeriod', description='The automatic renewal period of the instance. This parameter is required when the AutoRenew parameter is set to true. Valid values:  
- If the PeriodUnit parameter is set to Year: "1", "2", and "3".   
- If the PeriodUnit parameter is set to Month: "1", "2", "3", "6", and "12".', example='2'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:  
- PrePay: the subscription billing method. You must ensure that the remaining balance or credit balance of your account can cover the cost of the subscription. Otherwise, you will receive an InvalidPayMethod error. 
- PostPay: the pay-as-you-go billing method. This is the default value. By default, fees are charged on an hourly basis.

This parameter is required.', example='PrePay'),
  cpuArch?: string(name='CpuArch', example='x86'),
  diskSize?: long(name='DiskSize', description='The size of the storage space,in GB.    
The limits on the storage space vary with the cluster specifications:   
- 8C32GB: 100 GB to 10000 GB   
- 14C70GB: 200 GB to 10000 GB   
- 30C180GB: 400 GB to 10000 GB   
- 62C400GB: 800 GB to 10000 GB    
The preceding minimum storage space sizes are the default storage space sizes of the corresponding cluster specification plans.', example='200'),
  diskType?: string(name='DiskType', description='The type of the storage disk where the cluster is deployed. This parameter takes effect only for Standard Cluster Edition (Cloud Disk).
Valid values:
- cloud_essd_pl1: ESSD PL1.
- cloud_essd_pl0: ESSD PL0. Default value: cloud_essd_pl1.', example='cloud_essd_pl1'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run for the request. Default value: false. Valid values:
- true: Only a dry-run request is sent and the instance is not created. If the dry run succeeds, DryRunResult=true is returned. If the dry run fails, an error code is returned.
- false: The actual request is sent and no dry run is performed. The instance is created if the requirements are met. By default, the DryRunResult parameter returns false if you set DryRun to false.', example='false'),
  instanceClass?: string(name='InstanceClass', description='The specifications of the cluster.     
You can specify one of the following four plans:   
 - 8C32GB: indicates 8 CPU cores and 32 GB of memory.    
 - 14C70GB: indicates 14 CPU cores and 70 GB of memory. This is the default value.
- 30C180GB: indicates 30 CPU cores and 180 GB of memory.     
- 62C400GB: indicates 62 CPU cores and 400 GB of memory.

This parameter is required.', example='14C70GB'),
  instanceName?: string(name='InstanceName', description='The name of the OceanBase cluster.    
It must be 1 to 20 characters in length.   
If this parameter is not specified, the value is the instance ID of the cluster by default.', example='amap_aos_tx_ob'),
  isolationOptimization?: string(name='IsolationOptimization', description='Specifies whether to enable the control group feature.
Valid values:
- true
- false', example='true'),
  obVersion?: string(name='ObVersion', description='OceanBase Server version number.', example='2.2.77'),
  period?: long(name='Period', description='The valid duration of the purchased resources. The unit is specified by the PeriodUnit parameter.   
This parameter is valid and required only when the InstanceChargeType parameter is set to PrePaid.      
Valid values:     
- When the PeriodUnit parameter is set to Month: "1", "2", "3", "4", "5", "6", "7", "8", "9". 
- When the PeriodUnit parameter is set to Year: "1", "2", "3".', example='1'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the valid duration of the purchased resources.     
Valid value for subscription: Month or Year.
Default value: Month for subscription, and Hour for pay-as-you-go.', example='Month'),
  primaryInstance?: string(name='PrimaryInstance', description='Primary instance ID.', example='ob3h8ytroxxxxx'),
  primaryRegion?: string(name='PrimaryRegion', description='Primary instance region.', example='cn-hangzhou'),
  replicaMode?: string(name='ReplicaMode', description='The number of full-featured replicas.
- 3F: three full-featured replicas.
- 2F1L: two full-featured replicas and one log replica.
- 2F1A: two full-featured replicas and one arbitration service.
- ApsaraDB for OceanBase earlier than V4.1 supports 3F and 2F1L.
- ApsaraDB for OceanBase V4.1 or later supports 3F and 2F1A.
- An ApsaraDB for OceanBase instance deployed across three zones supports only 3F.
- An ApsaraDB for OceanBase instance deployed across two zones supports 2F1A or 2F1L, depending on the version.
- An ApsaraDB for OceanBase instance deployed in a single zone supports 3F, 2F1A, or 2F1L, depending on the version.', example='3F'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-bp67acfmxazb4p****'),
  series?: string(name='Series', description='The series of the OceanBase cluster. Valid values:    
- normal: Standard Cluster Edition (Cloud Disk). This is the default value.
- normal_ssd: Standard Cluster Edition (Local Disk).
- history: History Database Cluster Edition.

This parameter is required.', example='Normal'),
  zones?: string(name='Zones', description='The ID of the zone to which the instance belongs.   
For more information about how to obtain the list of zones, see [DescribeZones](https://help.aliyun.com/document_detail/25610.html).

This parameter is required.', example='cn-hangzhou-h,cn-hangzhou-i,cn-hangzhou-j'),
}

model CreateInstanceResponseBody = {
  data?: {
    dryRunResult?: boolean(name='DryRunResult', description='The result of the dry-run request.

If the DryRun parameter is set to true and the dry run succeeds, the DryRunResult parameter returns true. Otherwise, an error code is returned.
If the DryRun parameter is set to false, no dry run is performed and the DryRunResult parameter returns false.', example='true'),
    instanceId?: string(name='InstanceId', description='Instance ID.', example='i-bp67acfmxazb4p****'),
    orderId?: string(name='OrderId', description='Order ID. The ID of the order that you have placed.
This parameter returns a value after you create a pre-paid or post-paid cluster.', example='1234567890'),
    resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID.', example='rg-***************'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model CreateInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstanceResponseBody(name='body'),
}

/**
 * @summary You can call this operation to create an OceanBase cluster.
 *
 * @param request CreateInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstanceResponse
 */
async function createInstanceWithOptions(request: CreateInstanceRequest, runtime: Util.RuntimeOptions): CreateInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.autoRenew)) {
    body['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.autoRenewPeriod)) {
    body['AutoRenewPeriod'] = request.autoRenewPeriod;
  }
  if (!Util.isUnset(request.chargeType)) {
    body['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.cpuArch)) {
    body['CpuArch'] = request.cpuArch;
  }
  if (!Util.isUnset(request.diskSize)) {
    body['DiskSize'] = request.diskSize;
  }
  if (!Util.isUnset(request.diskType)) {
    body['DiskType'] = request.diskType;
  }
  if (!Util.isUnset(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.instanceClass)) {
    body['InstanceClass'] = request.instanceClass;
  }
  if (!Util.isUnset(request.instanceName)) {
    body['InstanceName'] = request.instanceName;
  }
  if (!Util.isUnset(request.isolationOptimization)) {
    body['IsolationOptimization'] = request.isolationOptimization;
  }
  if (!Util.isUnset(request.obVersion)) {
    body['ObVersion'] = request.obVersion;
  }
  if (!Util.isUnset(request.period)) {
    body['Period'] = request.period;
  }
  if (!Util.isUnset(request.periodUnit)) {
    body['PeriodUnit'] = request.periodUnit;
  }
  if (!Util.isUnset(request.primaryInstance)) {
    body['PrimaryInstance'] = request.primaryInstance;
  }
  if (!Util.isUnset(request.primaryRegion)) {
    body['PrimaryRegion'] = request.primaryRegion;
  }
  if (!Util.isUnset(request.replicaMode)) {
    body['ReplicaMode'] = request.replicaMode;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.series)) {
    body['Series'] = request.series;
  }
  if (!Util.isUnset(request.zones)) {
    body['Zones'] = request.zones;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateInstance',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to create an OceanBase cluster.
 *
 * @param request CreateInstanceRequest
 * @return CreateInstanceResponse
 */
async function createInstance(request: CreateInstanceRequest): CreateInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createInstanceWithOptions(request, runtime);
}

model CreateLabelRequest {
  name?: string(name='Name', description='This parameter is required.', example='test'),
}

model CreateLabelResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: string(name='Data', example='l_****'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='E3D924FB-52****B253-0C1A7EFB778C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='24'),
}

model CreateLabelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLabelResponseBody(name='body'),
}

/**
 * @summary 创建标签
 *
 * @param request CreateLabelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLabelResponse
 */
async function createLabelWithOptions(request: CreateLabelRequest, runtime: Util.RuntimeOptions): CreateLabelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateLabel',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建标签
 *
 * @param request CreateLabelRequest
 * @return CreateLabelResponse
 */
async function createLabel(request: CreateLabelRequest): CreateLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLabelWithOptions(request, runtime);
}

model CreateMySqlDataSourceRequest {
  description?: string(name='Description', example='test'),
  dgInstanceId?: string(name='DgInstanceId', example='dg-x****'),
  instanceId?: string(name='InstanceId', example='rm-t4****'),
  ip?: string(name='Ip', example='xxx.xxx.xxx.1'),
  name?: string(name='Name', description='This parameter is required.', example='source_name'),
  password?: string(name='Password', description='This parameter is required.', example='pass_word'),
  port?: int32(name='Port', example='2883'),
  schema?: string(name='Schema', example='test'),
  type?: string(name='Type', description='This parameter is required.', example='VPC'),
  useSsl?: boolean(name='UseSsl'),
  userName?: string(name='UserName', description='This parameter is required.', example='user_name'),
  vpcId?: string(name='VpcId', example='vpc-bp1d2q3mhg9i23ofi****'),
}

model CreateMySqlDataSourceResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: string(name='Data', example='e_edz****'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='null'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='24'),
}

model CreateMySqlDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMySqlDataSourceResponseBody(name='body'),
}

/**
 * @summary 创建 MySQL 数据源
 *
 * @param request CreateMySqlDataSourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMySqlDataSourceResponse
 */
async function createMySqlDataSourceWithOptions(request: CreateMySqlDataSourceRequest, runtime: Util.RuntimeOptions): CreateMySqlDataSourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.dgInstanceId)) {
    body['DgInstanceId'] = request.dgInstanceId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ip)) {
    body['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.password)) {
    body['Password'] = request.password;
  }
  if (!Util.isUnset(request.port)) {
    body['Port'] = request.port;
  }
  if (!Util.isUnset(request.schema)) {
    body['Schema'] = request.schema;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.useSsl)) {
    body['UseSsl'] = request.useSsl;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  if (!Util.isUnset(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateMySqlDataSource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建 MySQL 数据源
 *
 * @param request CreateMySqlDataSourceRequest
 * @return CreateMySqlDataSourceResponse
 */
async function createMySqlDataSource(request: CreateMySqlDataSourceRequest): CreateMySqlDataSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMySqlDataSourceWithOptions(request, runtime);
}

model CreateOceanBaseDataSourceRequest {
  cluster?: string(name='Cluster', example='cluster_name'),
  configUrl?: string(name='ConfigUrl', example='http://xxx.xxx.xxx.2:2883/services?Action=ObRootServiceInfo&User_ID=alibaba&UID=ocpmaster&ObRegion=ob_1***29.admin'),
  description?: string(name='Description', example='test'),
  drcPassword?: string(name='DrcPassword', example='pas***'),
  drcUserName?: string(name='DrcUserName', example='user_na***'),
  innerDrcPassword?: string(name='InnerDrcPassword', example='in***'),
  ip?: string(name='Ip', example='xxx.xxx.xxx.1'),
  logProxyIp?: string(name='LogProxyIp', description='LogProxy IP。', example='null'),
  logProxyPort?: string(name='LogProxyPort', example='null'),
  name?: string(name='Name', description='This parameter is required.', example='source_name'),
  password?: string(name='Password', description='This parameter is required.', example='pass_word'),
  port?: int32(name='Port', example='2883'),
  tenant?: string(name='Tenant', description='This parameter is required.', example='tenant_name'),
  type?: string(name='Type', description='This parameter is required.', example='OB_MYSQL_VPC'),
  userName?: string(name='UserName', description='This parameter is required.', example='user_name'),
  vpcId?: string(name='VpcId', example='vpc-bp1d2q3mhg9i23ofi****'),
}

model CreateOceanBaseDataSourceResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='null'),
  cost?: string(name='Cost', example='1'),
  data?: string(name='Data', example='e_edz****'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='30'),
}

model CreateOceanBaseDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOceanBaseDataSourceResponseBody(name='body'),
}

/**
 * @summary 创建 OceanBase 数据源
 *
 * @param request CreateOceanBaseDataSourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateOceanBaseDataSourceResponse
 */
async function createOceanBaseDataSourceWithOptions(request: CreateOceanBaseDataSourceRequest, runtime: Util.RuntimeOptions): CreateOceanBaseDataSourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cluster)) {
    body['Cluster'] = request.cluster;
  }
  if (!Util.isUnset(request.configUrl)) {
    body['ConfigUrl'] = request.configUrl;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.drcPassword)) {
    body['DrcPassword'] = request.drcPassword;
  }
  if (!Util.isUnset(request.drcUserName)) {
    body['DrcUserName'] = request.drcUserName;
  }
  if (!Util.isUnset(request.innerDrcPassword)) {
    body['InnerDrcPassword'] = request.innerDrcPassword;
  }
  if (!Util.isUnset(request.ip)) {
    body['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.logProxyIp)) {
    body['LogProxyIp'] = request.logProxyIp;
  }
  if (!Util.isUnset(request.logProxyPort)) {
    body['LogProxyPort'] = request.logProxyPort;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.password)) {
    body['Password'] = request.password;
  }
  if (!Util.isUnset(request.port)) {
    body['Port'] = request.port;
  }
  if (!Util.isUnset(request.tenant)) {
    body['Tenant'] = request.tenant;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  if (!Util.isUnset(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateOceanBaseDataSource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建 OceanBase 数据源
 *
 * @param request CreateOceanBaseDataSourceRequest
 * @return CreateOceanBaseDataSourceResponse
 */
async function createOceanBaseDataSource(request: CreateOceanBaseDataSourceRequest): CreateOceanBaseDataSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createOceanBaseDataSourceWithOptions(request, runtime);
}

model CreateOmsMysqlDataSourceRequest {
  description?: string(name='Description', description='The description of the data source.   

It must be 2 to 256 characters in length. The default value is null.', example='MySQL data source for OMS testing'),
  dgDatabaseId?: string(name='DgDatabaseId', description='The ID of the database gateway instance.   

> <br>If Type is set to DG, this parameter is required.', example='dg-yhss6sdlaff****'),
  instanceId?: string(name='InstanceId', description='The ID of the ECS instance of the data source.   

> <br>If Type is set to RDS, PolarDB, or DG, this parameter is required.', example='pc-12ab34cd56******'),
  ip?: string(name='Ip', description='The IP address of the data source.   

> <br>If Type is set to INTERNET or VPC, this parameter is required.', example='10.0.****'),
  name?: string(name='Name', description='The name of the data source.   
It must be 2 to 128 characters in length and can contain letters, digits, underscores (_), periods (.), and hyphens (-).   

> <br>Invalid characters, such as slashes (/), are not allowed.

This parameter is required.', example='oms-mysql'),
  password?: string(name='Password', description='The password of the username that is used to access the database. It must be Base64 encoded.   
For example, for the password abcd123@!, the Base64-encoded value is YWJjZDEyM0Ah.

This parameter is required.', example='YWJjZDEyM0Ah'),
  port?: string(name='Port', description='The port number of the data source.   

> <br>If Type is set to INTERNET or VPC, this parameter is required.', example='3306'),
  schema?: string(name='Schema', description='The name of the database.   

> <br>If you specify this parameter, subsequent migration or synchronization operations will take effect on this database only.', example='test'),
  type?: string(name='Type', description='The type of the MySQL data source.   
Valid values: INTERNET, VPC, RDS, PolarDB, and DG.

This parameter is required.', example='INTERNET'),
  username?: string(name='Username', description='The username that is used to access the database.

This parameter is required.', example='omsTestUser'),
  vpcId?: string(name='VpcId', description='The ID of the VPC to which the data source belongs.   

> <br>If Type is set to VPC, this parameter is required.', example='vpc-12345abcde*******'),
}

model CreateOmsMysqlDataSourceResponseBody = {
  data?: {
    endpointId?: string(name='EndpointId', description='The ID of the data source record.', example='e_1234abcd*****'),
  }(name='Data', description='The return result of the request.'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model CreateOmsMysqlDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOmsMysqlDataSourceResponseBody(name='body'),
}

/**
 * @summary You can call this operation to create a MySQL data source.
 *
 * @description To call this operation, you must add the IP address of the OceanBase Migration Service (OMS) server to the whitelist of the Alibaba Cloud database instance, the security rules of the ECS instance, or the security settings of your self-managed database (usually the firewall of your self-managed database) to ensure that OMS can successfully access your database instance. To obtain the IP address of the OMS server, go to the OMS data source management page in the OMS console.
 *
 * @param request CreateOmsMysqlDataSourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateOmsMysqlDataSourceResponse
 */
async function createOmsMysqlDataSourceWithOptions(request: CreateOmsMysqlDataSourceRequest, runtime: Util.RuntimeOptions): CreateOmsMysqlDataSourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.dgDatabaseId)) {
    body['DgDatabaseId'] = request.dgDatabaseId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ip)) {
    body['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.password)) {
    body['Password'] = request.password;
  }
  if (!Util.isUnset(request.port)) {
    body['Port'] = request.port;
  }
  if (!Util.isUnset(request.schema)) {
    body['Schema'] = request.schema;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.username)) {
    body['Username'] = request.username;
  }
  if (!Util.isUnset(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateOmsMysqlDataSource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to create a MySQL data source.
 *
 * @description To call this operation, you must add the IP address of the OceanBase Migration Service (OMS) server to the whitelist of the Alibaba Cloud database instance, the security rules of the ECS instance, or the security settings of your self-managed database (usually the firewall of your self-managed database) to ensure that OMS can successfully access your database instance. To obtain the IP address of the OMS server, go to the OMS data source management page in the OMS console.
 *
 * @param request CreateOmsMysqlDataSourceRequest
 * @return CreateOmsMysqlDataSourceResponse
 */
async function createOmsMysqlDataSource(request: CreateOmsMysqlDataSourceRequest): CreateOmsMysqlDataSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createOmsMysqlDataSourceWithOptions(request, runtime);
}

model CreateProjectRequest {
  commonTransferConfig?: {
    activeActive?: boolean(name='ActiveActive', example='false'),
    customColumns?: [ 
      {
        columnName?: string(name='ColumnName'),
        expression?: string(name='Expression'),
      }
    ](name='CustomColumns'),
    dataWorksBusinessName?: string(name='DataWorksBusinessName', example='null'),
    datahubTopicType?: string(name='DatahubTopicType', example='TUPLE'),
    mqPartition?: int32(name='MqPartition', example='0'),
    mqPartitionMode?: string(name='MqPartitionMode', example='ONE'),
    mqSerializerType?: string(name='MqSerializerType', example='DEFAULT'),
    rocketMqEnableMsgTrace?: boolean(name='RocketMqEnableMsgTrace', example='false'),
    rocketMqMsgTags?: string(name='RocketMqMsgTags', example='default_tag'),
    rocketMqProducerGroup?: string(name='RocketMqProducerGroup', example='OMS'),
    rocketMqSendMsgTimeout?: long(name='RocketMqSendMsgTimeout', example='null'),
    sinkStoreFormat?: string(name='SinkStoreFormat'),
    sourceStoreFormat?: string(name='SourceStoreFormat'),
    syncSchema?: boolean(name='SyncSchema'),
    syncSchemaColumnName?: string(name='SyncSchemaColumnName'),
    tableCategory?: string(name='TableCategory', example='ALL'),
  }(name='CommonTransferConfig'),
  enableFullTransfer?: boolean(name='EnableFullTransfer', example='true'),
  enableFullVerify?: boolean(name='EnableFullVerify', example='true'),
  enableIncrTransfer?: boolean(name='EnableIncrTransfer', example='true'),
  enableReverseIncrTransfer?: boolean(name='EnableReverseIncrTransfer', example='true'),
  enableStructTransfer?: boolean(name='EnableStructTransfer', example='true'),
  fullTransferConfig?: {
    allowDestTableNotEmpty?: boolean(name='AllowDestTableNotEmpty', example='true'),
    fullTransferSpeedMode?: string(name='FullTransferSpeedMode', example='NORMAL'),
    fullVerifySpeedMode?: string(name='FullVerifySpeedMode', example='NORMAL'),
    hbaseObjCheckMode?: string(name='HbaseObjCheckMode'),
    hbaseObjMigMode?: string(name='HbaseObjMigMode'),
    indexDDLConcurrencyLimit?: int32(name='IndexDDLConcurrencyLimit'),
    maxConcurrentIndexDDLs?: int32(name='MaxConcurrentIndexDDLs'),
    nonePkUkTruncateDstTable?: boolean(name='NonePkUkTruncateDstTable', example='true'),
    readWorkerNum?: int32(name='ReadWorkerNum'),
    throttleIOPS?: int32(name='ThrottleIOPS'),
    throttleRps?: int32(name='ThrottleRps'),
    writeWorkerNum?: int32(name='WriteWorkerNum'),
  }(name='FullTransferConfig'),
  id?: string(name='Id', description='This parameter is required.'),
  incrTransferConfig?: {
    enableIncrSyncStatistics?: boolean(name='EnableIncrSyncStatistics', example='true'),
    enableSequencingWithinTxn?: boolean(name='EnableSequencingWithinTxn', example='true'),
    incrSyncConcurrency?: int32(name='IncrSyncConcurrency', example='64'),
    recordTypeWhiteList?: [ string ](name='RecordTypeWhiteList'),
    startTimestamp?: string(name='StartTimestamp', example='1689201369'),
    storeLogKeptHour?: int32(name='StoreLogKeptHour', example='24'),
    supportDDLTypes?: [ string ](name='SupportDDLTypes'),
    throttleIOPS?: int32(name='ThrottleIOPS'),
    throttleRps?: int32(name='ThrottleRps'),
  }(name='IncrTransferConfig'),
  labelIds?: [ string ](name='LabelIds'),
  name?: string(name='Name', description='This parameter is required.', example='test'),
  ossKey?: string(name='OssKey', example='open_api_create_project/oacp_xxx'),
  reverseIncrTransferConfig?: {
    enableIncrSyncStatistics?: boolean(name='EnableIncrSyncStatistics'),
    enableSequencingWithinTxn?: boolean(name='EnableSequencingWithinTxn'),
    incrSyncConcurrency?: int32(name='IncrSyncConcurrency'),
    recordTypeWhiteList?: [ string ](name='RecordTypeWhiteList'),
    startTimestamp?: string(name='StartTimestamp'),
    storeLogKeptHour?: int32(name='StoreLogKeptHour'),
    supportDDLTypes?: [ string ](name='SupportDDLTypes'),
    throttleIOPS?: int32(name='ThrottleIOPS'),
    throttleRps?: int32(name='ThrottleRps'),
  }(name='ReverseIncrTransferConfig'),
  sinkEndpointId?: string(name='SinkEndpointId', description='This parameter is required.', example='e_4j0cz****'),
  sourceEndpointId?: string(name='SourceEndpointId', description='This parameter is required.', example='e_4j0c12z****'),
  structTransferConfig?: {
    byteCharConvertStrategy?: string(name='ByteCharConvertStrategy', example='DO_NOTHING_IF_BYTE_USED'),
    deferIndexCreation?: boolean(name='DeferIndexCreation', example='true'),
  }(name='StructTransferConfig'),
  transferMapping?: {
    databases?: [ 
      {
        clusterName?: string(name='ClusterName', example='cluster_name'),
        id?: string(name='Id', example='gez3***'),
        mappedName?: string(name='MappedName', example='mapped_db'),
        name?: string(name='Name', example='db_name'),
        specificTables?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
              partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id', example='e_4azdil4lu7***'),
            mappedName?: string(name='MappedName', example='mapped_table'),
            name?: string(name='Name', example='table_name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause', example='id<5'),
          }
        ](name='SpecificTables'),
        specificViews?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
              partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id', example='e_3wsmjv49a***'),
            mappedName?: string(name='MappedName', example='mapped_view'),
            name?: string(name='Name', example='view_name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause', example='id<5'),
          }
        ](name='SpecificViews'),
        tables?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
              partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id', example='e_4l085bu7***'),
            mappedName?: string(name='MappedName', example='mapped_table'),
            name?: string(name='Name', example='table_name'),
            obkvPartitionConfig?: {
              partitionSize?: int32(name='PartitionSize'),
              partitionType?: string(name='PartitionType'),
              virtualColumn?: string(name='VirtualColumn'),
            }(name='ObkvPartitionConfig'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause', example='id > 1'),
          }
        ](name='Tables'),
        tenantName?: string(name='TenantName', example='tenant_name'),
        views?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
              partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id', example='e_4himpq4z***'),
            mappedName?: string(name='MappedName', example='mapped_view'),
            name?: string(name='Name', example='view_name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause', example='id>1'),
          }
        ](name='Views'),
      }
    ](name='Databases'),
    databasesBlack?: [ 
      {
        clusterName?: string(name='ClusterName', example='cluster_name'),
        id?: string(name='Id', example='e_3y6v5v1x94f4'),
        mappedName?: string(name='MappedName', example='mapped_db'),
        name?: string(name='Name', example='db_name'),
        specificTables?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
              partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id', example='e_4himpq4zf***'),
            mappedName?: string(name='MappedName', example='mapped_table'),
            name?: string(name='Name', example='table_name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause', example='id<1'),
          }
        ](name='SpecificTables'),
        specificViews?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
              partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id', example='e_474hmh5iqo***'),
            mappedName?: string(name='MappedName', example='mapped_table'),
            name?: string(name='Name', example='table_name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause', example='id<1'),
          }
        ](name='SpecificViews'),
        tables?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
              partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id', example='e_474hmh5iqo***'),
            mappedName?: string(name='MappedName', example='mapped_table'),
            name?: string(name='Name', example='table_name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause', example='id<1'),
          }
        ](name='Tables'),
        tenantName?: string(name='TenantName', example='tenant_name'),
        views?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
              partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id', example='e_4azdil4lu7mo'),
            mappedName?: string(name='MappedName', example='mapped_view'),
            name?: string(name='Name', example='view_name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause', example='id<5'),
          }
        ](name='Views'),
      }
    ](name='DatabasesBlack'),
    mode?: string(name='Mode', example='SPCEIFIC'),
    tableAndViewBlackList?: [ string ](name='TableAndViewBlackList'),
    tableAndViewWhiteList?: [ string ](name='TableAndViewWhiteList'),
  }(name='TransferMapping', description='This parameter is required.'),
  type?: string(name='Type', description='This parameter is required.', example='MIGRATION'),
  useOss?: boolean(name='UseOss', example='true'),
  workerGradeId?: string(name='WorkerGradeId', description='This parameter is required.', example='g_abcdefj***'),
}

model CreateProjectShrinkRequest {
  commonTransferConfigShrink?: string(name='CommonTransferConfig'),
  enableFullTransfer?: boolean(name='EnableFullTransfer', example='true'),
  enableFullVerify?: boolean(name='EnableFullVerify', example='true'),
  enableIncrTransfer?: boolean(name='EnableIncrTransfer', example='true'),
  enableReverseIncrTransfer?: boolean(name='EnableReverseIncrTransfer', example='true'),
  enableStructTransfer?: boolean(name='EnableStructTransfer', example='true'),
  fullTransferConfigShrink?: string(name='FullTransferConfig'),
  id?: string(name='Id', description='This parameter is required.'),
  incrTransferConfigShrink?: string(name='IncrTransferConfig'),
  labelIdsShrink?: string(name='LabelIds'),
  name?: string(name='Name', description='This parameter is required.', example='test'),
  ossKey?: string(name='OssKey', example='open_api_create_project/oacp_xxx'),
  reverseIncrTransferConfigShrink?: string(name='ReverseIncrTransferConfig'),
  sinkEndpointId?: string(name='SinkEndpointId', description='This parameter is required.', example='e_4j0cz****'),
  sourceEndpointId?: string(name='SourceEndpointId', description='This parameter is required.', example='e_4j0c12z****'),
  structTransferConfigShrink?: string(name='StructTransferConfig'),
  transferMappingShrink?: string(name='TransferMapping', description='This parameter is required.'),
  type?: string(name='Type', description='This parameter is required.', example='MIGRATION'),
  useOss?: boolean(name='UseOss', example='true'),
  workerGradeId?: string(name='WorkerGradeId', description='This parameter is required.', example='g_abcdefj***'),
}

model CreateProjectResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='27'),
  data?: string(name='Data', example='np_****'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='XCVSADG****DSGDS'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model CreateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProjectResponseBody(name='body'),
}

/**
 * @summary 创建项目
 *
 * @param tmpReq CreateProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProjectResponse
 */
async function createProjectWithOptions(tmpReq: CreateProjectRequest, runtime: Util.RuntimeOptions): CreateProjectResponse {
  Util.validateModel(tmpReq);
  var request = new CreateProjectShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.commonTransferConfig)) {
    request.commonTransferConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.commonTransferConfig, 'CommonTransferConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.fullTransferConfig)) {
    request.fullTransferConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.fullTransferConfig, 'FullTransferConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.incrTransferConfig)) {
    request.incrTransferConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.incrTransferConfig, 'IncrTransferConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.labelIds)) {
    request.labelIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.labelIds, 'LabelIds', 'json');
  }
  if (!Util.isUnset(tmpReq.reverseIncrTransferConfig)) {
    request.reverseIncrTransferConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.reverseIncrTransferConfig, 'ReverseIncrTransferConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.structTransferConfig)) {
    request.structTransferConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.structTransferConfig, 'StructTransferConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.transferMapping)) {
    request.transferMappingShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.transferMapping, 'TransferMapping', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.commonTransferConfigShrink)) {
    body['CommonTransferConfig'] = request.commonTransferConfigShrink;
  }
  if (!Util.isUnset(request.enableFullTransfer)) {
    body['EnableFullTransfer'] = request.enableFullTransfer;
  }
  if (!Util.isUnset(request.enableFullVerify)) {
    body['EnableFullVerify'] = request.enableFullVerify;
  }
  if (!Util.isUnset(request.enableIncrTransfer)) {
    body['EnableIncrTransfer'] = request.enableIncrTransfer;
  }
  if (!Util.isUnset(request.enableReverseIncrTransfer)) {
    body['EnableReverseIncrTransfer'] = request.enableReverseIncrTransfer;
  }
  if (!Util.isUnset(request.enableStructTransfer)) {
    body['EnableStructTransfer'] = request.enableStructTransfer;
  }
  if (!Util.isUnset(request.fullTransferConfigShrink)) {
    body['FullTransferConfig'] = request.fullTransferConfigShrink;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.incrTransferConfigShrink)) {
    body['IncrTransferConfig'] = request.incrTransferConfigShrink;
  }
  if (!Util.isUnset(request.labelIdsShrink)) {
    body['LabelIds'] = request.labelIdsShrink;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.ossKey)) {
    body['OssKey'] = request.ossKey;
  }
  if (!Util.isUnset(request.reverseIncrTransferConfigShrink)) {
    body['ReverseIncrTransferConfig'] = request.reverseIncrTransferConfigShrink;
  }
  if (!Util.isUnset(request.sinkEndpointId)) {
    body['SinkEndpointId'] = request.sinkEndpointId;
  }
  if (!Util.isUnset(request.sourceEndpointId)) {
    body['SourceEndpointId'] = request.sourceEndpointId;
  }
  if (!Util.isUnset(request.structTransferConfigShrink)) {
    body['StructTransferConfig'] = request.structTransferConfigShrink;
  }
  if (!Util.isUnset(request.transferMappingShrink)) {
    body['TransferMapping'] = request.transferMappingShrink;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.useOss)) {
    body['UseOss'] = request.useOss;
  }
  if (!Util.isUnset(request.workerGradeId)) {
    body['WorkerGradeId'] = request.workerGradeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProject',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建项目
 *
 * @param request CreateProjectRequest
 * @return CreateProjectResponse
 */
async function createProject(request: CreateProjectRequest): CreateProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return createProjectWithOptions(request, runtime);
}

model CreateProjectModifyRecordsRequest {
  databases?: [ 
    {
      id?: string(name='Id', example='db_id'),
      mappedName?: string(name='MappedName', example='mapped_db'),
      name?: string(name='Name', example='db_name'),
      specificTables?: [ 
        {
          adbTableSchema?: {
            distributedKeys?: [ string ](name='DistributedKeys'),
            partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
            partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
            primaryKeys?: [ string ](name='PrimaryKeys'),
          }(name='AdbTableSchema'),
          filterColumns?: [ string ](name='FilterColumns'),
          id?: string(name='Id', example='table_id'),
          mappedName?: string(name='MappedName', example='mapped_table'),
          name?: string(name='Name', example='table_name'),
          shardColumns?: [ string ](name='ShardColumns'),
          whereClause?: string(name='WhereClause', example='id<1'),
        }
      ](name='SpecificTables'),
      specificViews?: [ 
        {
          adbTableSchema?: {
            distributedKeys?: [ string ](name='DistributedKeys'),
            partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
            partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
            primaryKeys?: [ string ](name='PrimaryKeys'),
          }(name='AdbTableSchema'),
          filterColumns?: [ string ](name='FilterColumns'),
          id?: string(name='Id', example='view_id'),
          mappedName?: string(name='MappedName', example='mapped_view'),
          name?: string(name='Name', example='view_name'),
          shardColumns?: [ string ](name='ShardColumns'),
          whereClause?: string(name='WhereClause', example='id <1'),
        }
      ](name='SpecificViews'),
      tables?: [ 
        {
          adbTableSchema?: {
            distributedKeys?: [ string ](name='DistributedKeys'),
            partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
            partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
            primaryKeys?: [ string ](name='PrimaryKeys'),
          }(name='AdbTableSchema'),
          filterColumns?: [ string ](name='FilterColumns'),
          id?: string(name='Id', example='table_id'),
          mappedName?: string(name='MappedName', example='mapped_table'),
          name?: string(name='Name', example='table_name'),
          obkvPartitionConfig?: {
            partitionSize?: int32(name='PartitionSize'),
            partitionType?: string(name='PartitionType'),
            virtualColumn?: string(name='VirtualColumn'),
          }(name='ObkvPartitionConfig'),
          shardColumns?: [ string ](name='ShardColumns'),
          whereClause?: string(name='WhereClause', example='id<1'),
        }
      ](name='Tables'),
      views?: [ 
        {
          adbTableSchema?: {
            distributedKeys?: [ string ](name='DistributedKeys'),
            partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
            partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
            primaryKeys?: [ string ](name='PrimaryKeys'),
          }(name='AdbTableSchema'),
          filterColumns?: [ string ](name='FilterColumns'),
          id?: string(name='Id', example='view_id'),
          mappedName?: string(name='MappedName', example='mapped_view'),
          name?: string(name='Name', example='view_name'),
          shardColumns?: [ string ](name='ShardColumns'),
          whereClause?: string(name='WhereClause', example='id<1'),
        }
      ](name='Views'),
    }
  ](name='Databases'),
  id?: string(name='Id', description='This parameter is required.', example='np_fe****'),
  transferMapping?: {
    blackTableRules?: [ 
      {
        objectMapping?: {
          mappedName?: string(name='MappedName'),
          name?: string(name='Name'),
        }(name='ObjectMapping'),
        schemaMapping?: {
          mappedName?: string(name='MappedName'),
          name?: string(name='Name'),
        }(name='SchemaMapping'),
      }
    ](name='BlackTableRules'),
    blackViewRules?: [ 
      {
        objectMapping?: {
          mappedName?: string(name='MappedName'),
          name?: string(name='Name'),
        }(name='ObjectMapping'),
        schemaMapping?: {
          mappedName?: string(name='MappedName'),
          name?: string(name='Name'),
        }(name='SchemaMapping'),
      }
    ](name='BlackViewRules'),
    databases?: [ 
      {
        clusterName?: string(name='ClusterName'),
        id?: string(name='Id'),
        mappedName?: string(name='MappedName'),
        name?: string(name='Name'),
        specificTables?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='SpecificTables'),
        specificViews?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='SpecificViews'),
        tables?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            obkvPartitionConfig?: {
              partitionSize?: int32(name='PartitionSize'),
              partitionType?: string(name='PartitionType'),
              virtualColumn?: string(name='VirtualColumn'),
            }(name='ObkvPartitionConfig'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='Tables'),
        tenantName?: string(name='TenantName'),
        views?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='Views'),
      }
    ](name='Databases'),
    databasesBlack?: [ 
      {
        clusterName?: string(name='ClusterName'),
        id?: string(name='Id'),
        mappedName?: string(name='MappedName'),
        name?: string(name='Name'),
        specificTables?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='SpecificTables'),
        specificViews?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='SpecificViews'),
        tables?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='Tables'),
        tenantName?: string(name='TenantName'),
        views?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='Views'),
      }
    ](name='DatabasesBlack'),
    mode?: string(name='Mode', example='SPCEIFIC'),
    schemas?: [ 
      {
        clusterName?: string(name='ClusterName'),
        id?: string(name='Id'),
        mappedName?: string(name='MappedName'),
        name?: string(name='Name'),
        specificTables?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='SpecificTables'),
        specificViews?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='SpecificViews'),
        tables?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            obkvPartitionConfig?: {
              partitionSize?: int32(name='PartitionSize'),
              partitionType?: string(name='PartitionType'),
              virtualColumn?: string(name='VirtualColumn'),
            }(name='ObkvPartitionConfig'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='Tables'),
        tenantName?: string(name='TenantName'),
        views?: [ 
          {
            adbTableSchema?: {
              distributedKeys?: [ string ](name='DistributedKeys'),
              partitionLifeCycle?: string(name='PartitionLifeCycle'),
              partitionStatement?: string(name='PartitionStatement'),
              primaryKeys?: [ string ](name='PrimaryKeys'),
            }(name='AdbTableSchema'),
            filterColumns?: [ string ](name='FilterColumns'),
            id?: string(name='Id'),
            mappedName?: string(name='MappedName'),
            name?: string(name='Name'),
            shardColumns?: [ string ](name='ShardColumns'),
            whereClause?: string(name='WhereClause'),
          }
        ](name='Views'),
      }
    ](name='Schemas'),
    tableAndViewBlackList?: [ string ](name='TableAndViewBlackList'),
    tableAndViewWhiteList?: [ string ](name='TableAndViewWhiteList'),
    whiteTableRules?: [ 
      {
        objectMapping?: {
          mappedName?: string(name='MappedName'),
          name?: string(name='Name'),
        }(name='ObjectMapping'),
        schemaMapping?: {
          mappedName?: string(name='MappedName'),
          name?: string(name='Name'),
        }(name='SchemaMapping'),
      }
    ](name='WhiteTableRules'),
    whiteViewRules?: [ 
      {
        objectMapping?: {
          mappedName?: string(name='MappedName'),
          name?: string(name='Name'),
        }(name='ObjectMapping'),
        schemaMapping?: {
          mappedName?: string(name='MappedName'),
          name?: string(name='Name'),
        }(name='SchemaMapping'),
      }
    ](name='WhiteViewRules'),
  }(name='TransferMapping'),
}

model CreateProjectModifyRecordsShrinkRequest {
  databasesShrink?: string(name='Databases'),
  id?: string(name='Id', description='This parameter is required.', example='np_fe****'),
  transferMappingShrink?: string(name='TransferMapping'),
}

model CreateProjectModifyRecordsResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='28'),
  data?: long(name='Data', example='4'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model CreateProjectModifyRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProjectModifyRecordsResponseBody(name='body'),
}

/**
 * @summary 修改传输对象（加减表）(仅支持处于 RUNNING/FAILED/SUSPEND 状态的项目)
 *
 * @param tmpReq CreateProjectModifyRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProjectModifyRecordsResponse
 */
async function createProjectModifyRecordsWithOptions(tmpReq: CreateProjectModifyRecordsRequest, runtime: Util.RuntimeOptions): CreateProjectModifyRecordsResponse {
  Util.validateModel(tmpReq);
  var request = new CreateProjectModifyRecordsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.databases)) {
    request.databasesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.databases, 'Databases', 'json');
  }
  if (!Util.isUnset(tmpReq.transferMapping)) {
    request.transferMappingShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.transferMapping, 'TransferMapping', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.databasesShrink)) {
    body['Databases'] = request.databasesShrink;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.transferMappingShrink)) {
    body['TransferMapping'] = request.transferMappingShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProjectModifyRecords',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改传输对象（加减表）(仅支持处于 RUNNING/FAILED/SUSPEND 状态的项目)
 *
 * @param request CreateProjectModifyRecordsRequest
 * @return CreateProjectModifyRecordsResponse
 */
async function createProjectModifyRecords(request: CreateProjectModifyRecordsRequest): CreateProjectModifyRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createProjectModifyRecordsWithOptions(request, runtime);
}

model CreateRdsPostgreSQLDataSourceRequest {
  databaseName?: string(name='DatabaseName', description='This parameter is required.', example='db_name'),
  description?: string(name='Description', example='this is a test database'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='g_abcdefj***'),
  name?: string(name='Name', description='This parameter is required.', example='data_name'),
  password?: string(name='Password', description='This parameter is required.', example='pass_word'),
  userName?: string(name='UserName', description='This parameter is required.', example='user_name'),
}

model CreateRdsPostgreSQLDataSourceResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='30'),
  data?: string(name='Data', example='e_5anwndq'),
  errorDetail?: {
    code?: string(name='Code', example='INNER_ERROR'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model CreateRdsPostgreSQLDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRdsPostgreSQLDataSourceResponseBody(name='body'),
}

/**
 * @summary 创建RDS PG 数据源
 *
 * @param request CreateRdsPostgreSQLDataSourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRdsPostgreSQLDataSourceResponse
 */
async function createRdsPostgreSQLDataSourceWithOptions(request: CreateRdsPostgreSQLDataSourceRequest, runtime: Util.RuntimeOptions): CreateRdsPostgreSQLDataSourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.databaseName)) {
    body['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.password)) {
    body['Password'] = request.password;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateRdsPostgreSQLDataSource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建RDS PG 数据源
 *
 * @param request CreateRdsPostgreSQLDataSourceRequest
 * @return CreateRdsPostgreSQLDataSourceResponse
 */
async function createRdsPostgreSQLDataSource(request: CreateRdsPostgreSQLDataSourceRequest): CreateRdsPostgreSQLDataSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRdsPostgreSQLDataSourceWithOptions(request, runtime);
}

model CreateSecurityIpGroupRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  securityIpGroupName?: string(name='SecurityIpGroupName', description='The name of the whitelist group.

This parameter is required.', example='pay_online'),
  securityIps?: string(name='SecurityIps', description='The return result of the request.

This parameter is required.', example='{"192.168.1.1","192.168.0.0.1/8"}'),
}

model CreateSecurityIpGroupResponseBody = {
  requestId?: string(name='RequestId', description='The IP addresses or CIDR blocks in the IP address whitelist group.   
The return values of SecurityIps are strings that are separated with commas (,).', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  securityIpGroup?: {
    instanceId?: string(name='InstanceId', description='```
http(s)://[Endpoint]/?Action=CreateSecurityIpGroup
&InstanceId=ob317v4uif****
&SecurityIps=192.168.1.1,192.168.0.0.1/8
&SecurityIpGroupName=pay_online
&Common request parameters
```', example='ob317v4uif****'),
    securityIpGroupName?: string(name='SecurityIpGroupName', description='You can call this operation to create an IP address whitelist group.', example='pay_online'),
    securityIps?: string(name='SecurityIps', example='192.168.1.1,192.168.0.0.1/8'),
  }(name='SecurityIpGroup', description='The operation that you want to perform.   
Set the value to **CreateSecurityIpGroup**.'),
}

model CreateSecurityIpGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSecurityIpGroupResponseBody(name='body'),
}

/**
 * @summary The name of the whitelist group.
 *
 * @param request CreateSecurityIpGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSecurityIpGroupResponse
 */
async function createSecurityIpGroupWithOptions(request: CreateSecurityIpGroupRequest, runtime: Util.RuntimeOptions): CreateSecurityIpGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.securityIpGroupName)) {
    body['SecurityIpGroupName'] = request.securityIpGroupName;
  }
  if (!Util.isUnset(request.securityIps)) {
    body['SecurityIps'] = request.securityIps;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSecurityIpGroup',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The name of the whitelist group.
 *
 * @param request CreateSecurityIpGroupRequest
 * @return CreateSecurityIpGroupResponse
 */
async function createSecurityIpGroup(request: CreateSecurityIpGroupRequest): CreateSecurityIpGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSecurityIpGroupWithOptions(request, runtime);
}

model CreateTagRequest {
  clientToken?: string(name='ClientToken', description='The identifier of the client.', example='123e4567-e89b-12d3-a456-426655440000'),
  key?: string(name='Key', description='The name of the tag group.

This parameter is required.', example='Tag group 1'),
}

model CreateTagResponseBody = {
  message?: string(name='Message', description='The tag group creation result.', example='Create tag success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4C91F7BA-xxxx-xxxx-xxxx-846ECA1A9908'),
}

model CreateTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTagResponseBody(name='body'),
}

/**
 * @summary You can call this operation to create a tag group.
 *
 * @param request CreateTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTagResponse
 */
async function createTagWithOptions(request: CreateTagRequest, runtime: Util.RuntimeOptions): CreateTagResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.key)) {
    body['Key'] = request.key;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTag',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to create a tag group.
 *
 * @param request CreateTagRequest
 * @return CreateTagResponse
 */
async function createTag(request: CreateTagRequest): CreateTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTagWithOptions(request, runtime);
}

model CreateTagValueRequest {
  clientToken?: string(name='ClientToken', description='The identifier of the client.', example='123e4567-e89b-12d3-a456-426655440000'),
  key?: string(name='Key', description='The name of the tag group.

This parameter is required.', example='Tag group 1'),
  value?: string(name='Value', description='The name of the tag.

This parameter is required.', example='Tag 1'),
}

model CreateTagValueResponseBody = {
  message?: string(name='Message', description='The tag creation result.', example='create tag value success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4C91F7BA-xxxx-xxxx-xxxx-846ECA1A9908'),
}

model CreateTagValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTagValueResponseBody(name='body'),
}

/**
 * @summary You can call this operation to create a tag.
 *
 * @param request CreateTagValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTagValueResponse
 */
async function createTagValueWithOptions(request: CreateTagValueRequest, runtime: Util.RuntimeOptions): CreateTagValueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.key)) {
    body['Key'] = request.key;
  }
  if (!Util.isUnset(request.value)) {
    body['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTagValue',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to create a tag.
 *
 * @param request CreateTagValueRequest
 * @return CreateTagValueResponse
 */
async function createTagValue(request: CreateTagValueRequest): CreateTagValueResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTagValueWithOptions(request, runtime);
}

model CreateTenantRequest {
  charset?: string(name='Charset', description='The character set.    
For more information, see [DescribeCharset](https://www.alibabacloud.com/help/en/apsaradb-for-oceanbase/latest/api-oceanbasepro-2019-09-01-describecharset).

This parameter is required.', example='utf8mb4'),
  cpu?: int32(name='Cpu', description='The number of CPU cores of the tenant.   

> <br>The CPU specification of a single tenant cannot exceed that of the corresponding cluster. <br>For example, if the specification of the cluster is 14 CPU cores and 70 GB of memory, the CPU specification of the tenant cannot exceed 14 cores.

This parameter is required.', example='2'),
  createParams?: map[string]string(name='CreateParams', description='The initialization parameters.'),
  description?: string(name='Description', description='The description of the database.', example='this is a test database'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  logDisk?: long(name='LogDisk', description='The size of the log disk allocated to the tenant, in GB.', example='128'),
  memory?: int32(name='Memory', description='The memory size of the tenant, in GB.   

> <br>The memory size of a single tenant cannot exceed that of the corresponding cluster. <br>For example, if the specification of the cluster is 14 CPU cores and 70 GB of memory, the memory size of the tenant cannot exceed 70 GB.

This parameter is required.', example='10'),
  primaryZone?: string(name='PrimaryZone', description='The primary zone of the tenant.    
It is one of the zones in which the cluster is deployed.

This parameter is required.', example='cn-hangzhou-h'),
  readOnlyZoneList?: string(name='ReadOnlyZoneList', description='Specifies to create a read-only zone. Separate the names of multiple zones with commas (,).
>Notice: <br>At present, this parameter is unavailable.', example='cn-shanghai-g-ro,cn-shanghai-h-ro'),
  tenantMode?: string(name='TenantMode', description='The tenant mode.    
Valid values: Oracle and MySQL.   
For more information, see [DescribeInstanceTenantModes](https://www.alibabacloud.com/help/en/apsaradb-for-oceanbase/latest/api-oceanbasepro-2019-09-01-describeinstancetenantmodes).

This parameter is required.', example='Oracle'),
  tenantName?: string(name='TenantName', description='The name of the tenant.    
It must start with a letter or an underscore (_), and contain 2 to 20 characters, which can be uppercase letters, lowercase letters, digits, and underscores (_).  It cannot be set to sys.

This parameter is required.', example='pay_online'),
  timeZone?: string(name='TimeZone', description='The time zone of the tenant. For more information, see [DescribeTimeZones](https://www.alibabacloud.com/help/en/apsaradb-for-oceanbase/latest/api-oceanbasepro-2019-09-01-describetimezones).

This parameter is required.', example='Asia/Shanghai'),
  unitNum?: int32(name='UnitNum', description='The number of resource distribution nodes in the tenant.    
The number is determined by the deployment mode of the cluster. If the cluster is deployed in 2-2-2 mode, the maximum number of resource distribution nodes is 2.', example='2'),
  userVSwitchId?: string(name='UserVSwitchId', description='The ID of the vSwitch.    
If no suitable vSwitch is available, create a vSwitch as prompted.   
For more information, see Use a vSwitch.

This parameter is required.', example='vsw-bp11k1aypnzu1l3whi****'),
  userVpcId?: string(name='UserVpcId', description='The ID of the VPC.   
 If no suitable VPC is available, create a VPC as prompted.   
For more information, see "What is a VPC".

This parameter is required.', example='vpc-bp1d2q3mhg9i23ofi****'),
  userVpcOwnerId?: string(name='UserVpcOwnerId', description='The ID of the VPC owner.', example='vpc-********'),
}

model CreateTenantShrinkRequest {
  charset?: string(name='Charset', description='The character set.    
For more information, see [DescribeCharset](https://www.alibabacloud.com/help/en/apsaradb-for-oceanbase/latest/api-oceanbasepro-2019-09-01-describecharset).

This parameter is required.', example='utf8mb4'),
  cpu?: int32(name='Cpu', description='The number of CPU cores of the tenant.   

> <br>The CPU specification of a single tenant cannot exceed that of the corresponding cluster. <br>For example, if the specification of the cluster is 14 CPU cores and 70 GB of memory, the CPU specification of the tenant cannot exceed 14 cores.

This parameter is required.', example='2'),
  createParamsShrink?: string(name='CreateParams', description='The initialization parameters.'),
  description?: string(name='Description', description='The description of the database.', example='this is a test database'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  logDisk?: long(name='LogDisk', description='The size of the log disk allocated to the tenant, in GB.', example='128'),
  memory?: int32(name='Memory', description='The memory size of the tenant, in GB.   

> <br>The memory size of a single tenant cannot exceed that of the corresponding cluster. <br>For example, if the specification of the cluster is 14 CPU cores and 70 GB of memory, the memory size of the tenant cannot exceed 70 GB.

This parameter is required.', example='10'),
  primaryZone?: string(name='PrimaryZone', description='The primary zone of the tenant.    
It is one of the zones in which the cluster is deployed.

This parameter is required.', example='cn-hangzhou-h'),
  readOnlyZoneList?: string(name='ReadOnlyZoneList', description='Specifies to create a read-only zone. Separate the names of multiple zones with commas (,).
>Notice: <br>At present, this parameter is unavailable.', example='cn-shanghai-g-ro,cn-shanghai-h-ro'),
  tenantMode?: string(name='TenantMode', description='The tenant mode.    
Valid values: Oracle and MySQL.   
For more information, see [DescribeInstanceTenantModes](https://www.alibabacloud.com/help/en/apsaradb-for-oceanbase/latest/api-oceanbasepro-2019-09-01-describeinstancetenantmodes).

This parameter is required.', example='Oracle'),
  tenantName?: string(name='TenantName', description='The name of the tenant.    
It must start with a letter or an underscore (_), and contain 2 to 20 characters, which can be uppercase letters, lowercase letters, digits, and underscores (_).  It cannot be set to sys.

This parameter is required.', example='pay_online'),
  timeZone?: string(name='TimeZone', description='The time zone of the tenant. For more information, see [DescribeTimeZones](https://www.alibabacloud.com/help/en/apsaradb-for-oceanbase/latest/api-oceanbasepro-2019-09-01-describetimezones).

This parameter is required.', example='Asia/Shanghai'),
  unitNum?: int32(name='UnitNum', description='The number of resource distribution nodes in the tenant.    
The number is determined by the deployment mode of the cluster. If the cluster is deployed in 2-2-2 mode, the maximum number of resource distribution nodes is 2.', example='2'),
  userVSwitchId?: string(name='UserVSwitchId', description='The ID of the vSwitch.    
If no suitable vSwitch is available, create a vSwitch as prompted.   
For more information, see Use a vSwitch.

This parameter is required.', example='vsw-bp11k1aypnzu1l3whi****'),
  userVpcId?: string(name='UserVpcId', description='The ID of the VPC.   
 If no suitable VPC is available, create a VPC as prompted.   
For more information, see "What is a VPC".

This parameter is required.', example='vpc-bp1d2q3mhg9i23ofi****'),
  userVpcOwnerId?: string(name='UserVpcOwnerId', description='The ID of the VPC owner.', example='vpc-********'),
}

model CreateTenantResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t33h8y08k****'),
}

model CreateTenantResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTenantResponseBody(name='body'),
}

/**
 * @summary You can call this operation to create a tenant.
 *
 * @param tmpReq CreateTenantRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTenantResponse
 */
async function createTenantWithOptions(tmpReq: CreateTenantRequest, runtime: Util.RuntimeOptions): CreateTenantResponse {
  Util.validateModel(tmpReq);
  var request = new CreateTenantShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.createParams)) {
    request.createParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.createParams, 'CreateParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.charset)) {
    body['Charset'] = request.charset;
  }
  if (!Util.isUnset(request.cpu)) {
    body['Cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.createParamsShrink)) {
    body['CreateParams'] = request.createParamsShrink;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.logDisk)) {
    body['LogDisk'] = request.logDisk;
  }
  if (!Util.isUnset(request.memory)) {
    body['Memory'] = request.memory;
  }
  if (!Util.isUnset(request.primaryZone)) {
    body['PrimaryZone'] = request.primaryZone;
  }
  if (!Util.isUnset(request.readOnlyZoneList)) {
    body['ReadOnlyZoneList'] = request.readOnlyZoneList;
  }
  if (!Util.isUnset(request.tenantMode)) {
    body['TenantMode'] = request.tenantMode;
  }
  if (!Util.isUnset(request.tenantName)) {
    body['TenantName'] = request.tenantName;
  }
  if (!Util.isUnset(request.timeZone)) {
    body['TimeZone'] = request.timeZone;
  }
  if (!Util.isUnset(request.unitNum)) {
    body['UnitNum'] = request.unitNum;
  }
  if (!Util.isUnset(request.userVSwitchId)) {
    body['UserVSwitchId'] = request.userVSwitchId;
  }
  if (!Util.isUnset(request.userVpcId)) {
    body['UserVpcId'] = request.userVpcId;
  }
  if (!Util.isUnset(request.userVpcOwnerId)) {
    body['UserVpcOwnerId'] = request.userVpcOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTenant',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to create a tenant.
 *
 * @param request CreateTenantRequest
 * @return CreateTenantResponse
 */
async function createTenant(request: CreateTenantRequest): CreateTenantResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTenantWithOptions(request, runtime);
}

model CreateTenantReadOnlyConnectionRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='This parameter is required.', example='ob2mr3oae0****'),
  vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-bp11k1aypnzu1l3whi****'),
  vpcId?: string(name='VpcId', example='vpc-bp1d2q3mhg9i23ofi****'),
  zoneId?: string(name='ZoneId', description='This parameter is required.', example='cn-hangzhou-i'),
}

model CreateTenantReadOnlyConnectionResponseBody = {
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model CreateTenantReadOnlyConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTenantReadOnlyConnectionResponseBody(name='body'),
}

/**
 * @summary The request ID.
 *
 * @param request CreateTenantReadOnlyConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTenantReadOnlyConnectionResponse
 */
async function createTenantReadOnlyConnectionWithOptions(request: CreateTenantReadOnlyConnectionRequest, runtime: Util.RuntimeOptions): CreateTenantReadOnlyConnectionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    body['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    body['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTenantReadOnlyConnection',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The request ID.
 *
 * @param request CreateTenantReadOnlyConnectionRequest
 * @return CreateTenantReadOnlyConnectionResponse
 */
async function createTenantReadOnlyConnection(request: CreateTenantReadOnlyConnectionRequest): CreateTenantReadOnlyConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTenantReadOnlyConnectionWithOptions(request, runtime);
}

model CreateTenantSecurityIpGroupRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  securityIpGroupName?: string(name='SecurityIpGroupName', description='The group name of the whitelist group of IP addresses.

It starts with lowercase letters and ends with lowercase letters or numbers. It can only contain lowercase letters, numbers, and underscores, and should be 2~32 characters in length.

This parameter is required.', example='paytest'),
  securityIps?: string(name='SecurityIps', description='The list of IP addresses in the whitelist group.

It is a JSON array. Each object in the array is an IP address or a CIDR block. You can have up to 40 whitelists.

This parameter is required.', example='192.***.*.*"'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model CreateTenantSecurityIpGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  securityIpGroup?: {
    instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
    securityIpGroupName?: string(name='SecurityIpGroupName', description='The name of the whitelist group.', example='paytest'),
    securityIps?: string(name='SecurityIps', description='The list of IP addresses in the IP address whitelist group.   

It is a string separated by commas, and each object is an IP address or CIDR block.', example='192.***.*.*'),
    tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t4louaeei****'),
  }(name='SecurityIpGroup', description='The information of the whitelist group.'),
}

model CreateTenantSecurityIpGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTenantSecurityIpGroupResponseBody(name='body'),
}

/**
 * @summary You can call this operation to create the security whitelist for the tenant.
 *
 * @param request CreateTenantSecurityIpGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTenantSecurityIpGroupResponse
 */
async function createTenantSecurityIpGroupWithOptions(request: CreateTenantSecurityIpGroupRequest, runtime: Util.RuntimeOptions): CreateTenantSecurityIpGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.securityIpGroupName)) {
    body['SecurityIpGroupName'] = request.securityIpGroupName;
  }
  if (!Util.isUnset(request.securityIps)) {
    body['SecurityIps'] = request.securityIps;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTenantSecurityIpGroup',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to create the security whitelist for the tenant.
 *
 * @param request CreateTenantSecurityIpGroupRequest
 * @return CreateTenantSecurityIpGroupResponse
 */
async function createTenantSecurityIpGroup(request: CreateTenantSecurityIpGroupRequest): CreateTenantSecurityIpGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTenantSecurityIpGroupWithOptions(request, runtime);
}

model CreateTenantUserRequest {
  description?: string(name='Description', description='The description of the database.', example='this is a test database'),
  encryptionType?: string(name='EncryptionType', description='加密方式。', example='RAS'),
  globalPermissions?: string(name='GlobalPermissions', example='Encrypt,Decrypt'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  roles?: string(name='Roles', description='The role of the user account.  In Oracle mode, this parameter unspecified is left unspecified.  In MySQL mode, the super administrator account has ALL PRIVILEGES, and you can leave this parameter unspecified.  You need to specify the account information for a general user account. By default, the account information is a JSON array that contains the information of the role and the schema (Oracle mode) or database (MySQL mode).  Valid values: ReadWrite: a role that has the read and write privileges, namely ALL PRIVILEGES. ReadOnly: a role that has only the read-only privilege SELECT. DDL: a role that has DDL privileges such as CREATE, DROP, ALTER, SHOW VIEW, and CREATE VIEW. DML: a role that has DML privileges such as SELECT, INSERT, UPDATE, DELETE, and SHOW VIEW.', example='[{"Database":"oceanbase1","Role":"readwrite"},{"Database":"oceanbase2","Role":"readonly"}]'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='ob2mr3oae0****'),
  userName?: string(name='UserName', description='The name of the database account.  You cannot use reserved keywords, such as SYS and root.

This parameter is required.', example='pay_test'),
  userPassword?: string(name='UserPassword', description='The password of the database account.  It must be 10 to 32 characters in length and contain three types of the following characters: uppercase letters, lowercase letters, digits, and special characters. The special characters are ! @ # $ % \\\\ ^ \\\\ & \\\\ * ( ) _ + - =

This parameter is required.', example='!Aliyun4Oceanbase'),
  userType?: string(name='UserType', description='The type of the database account. Valid values: Admin: the super administrator account. Normal: a general account.

This parameter is required.', example='Normal'),
}

model CreateTenantUserResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenantUser?: {
    globalPermissions?: string(name='GlobalPermissions', example='Encrypt,Decrypt'),
    roles?: [ 
      {
        database?: string(name='Database', example='db_pay1'),
        role?: string(name='Role', example='ReadOnly'),
      }
    ](name='Roles'),
    userName?: string(name='UserName', example='pay_test'),
    userStatus?: string(name='UserStatus', example='ONLINE'),
    userType?: string(name='UserType'),
  }(name='TenantUser', description='The list of database accounts in the tenant.'),
}

model CreateTenantUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTenantUserResponseBody(name='body'),
}

/**
 * @summary CreateTenantUser
 *
 * @param request CreateTenantUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTenantUserResponse
 */
async function createTenantUserWithOptions(request: CreateTenantUserRequest, runtime: Util.RuntimeOptions): CreateTenantUserResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.encryptionType)) {
    body['EncryptionType'] = request.encryptionType;
  }
  if (!Util.isUnset(request.globalPermissions)) {
    body['GlobalPermissions'] = request.globalPermissions;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.roles)) {
    body['Roles'] = request.roles;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  if (!Util.isUnset(request.userPassword)) {
    body['UserPassword'] = request.userPassword;
  }
  if (!Util.isUnset(request.userType)) {
    body['UserType'] = request.userType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTenantUser',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary CreateTenantUser
 *
 * @param request CreateTenantUserRequest
 * @return CreateTenantUserResponse
 */
async function createTenantUser(request: CreateTenantUserRequest): CreateTenantUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTenantUserWithOptions(request, runtime);
}

model DeleteDataSourceRequest {
  id?: string(name='Id', description='This parameter is required.', example='e_5anwndq'),
}

model DeleteDataSourceResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='28'),
  data?: any(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='INNER_ERROR'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='E3D924FB-52****B253-0C1A7EFB778C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model DeleteDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDataSourceResponseBody(name='body'),
}

/**
 * @summary 删除数据源
 *
 * @param request DeleteDataSourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDataSourceResponse
 */
async function deleteDataSourceWithOptions(request: DeleteDataSourceRequest, runtime: Util.RuntimeOptions): DeleteDataSourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDataSource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除数据源
 *
 * @param request DeleteDataSourceRequest
 * @return DeleteDataSourceResponse
 */
async function deleteDataSource(request: DeleteDataSourceRequest): DeleteDataSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDataSourceWithOptions(request, runtime);
}

model DeleteDatabasesRequest {
  databaseNames?: string(name='DatabaseNames', description='This parameter is required.', example='["sms_pre", "pay_pre"]'),
  instanceId?: string(name='InstanceId', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='This parameter is required.', example='ob2mr3oae0****'),
}

model DeleteDatabasesResponseBody = {
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DeleteDatabasesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDatabasesResponseBody(name='body'),
}

/**
 * @summary The request ID.
 *
 * @param request DeleteDatabasesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDatabasesResponse
 */
async function deleteDatabasesWithOptions(request: DeleteDatabasesRequest, runtime: Util.RuntimeOptions): DeleteDatabasesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.databaseNames)) {
    body['DatabaseNames'] = request.databaseNames;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDatabases',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The request ID.
 *
 * @param request DeleteDatabasesRequest
 * @return DeleteDatabasesResponse
 */
async function deleteDatabases(request: DeleteDatabasesRequest): DeleteDatabasesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDatabasesWithOptions(request, runtime);
}

model DeleteInstancesRequest {
  backupRetainMode?: string(name='BackupRetainMode', description='The backup retention strategy for cluster deletion. Valid values:  
- receive_all: retains all backup sets.   
- delete_all: deletes all backup sets.   
- receive_last: retains the last backup set.    

> <br>Default value: delete_all.', example='delete_all'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run for the request. Default value: false. Valid values:
- true: Only a dry-run request is sent and the instance is not deleted. If the dry run succeeds, DryRunResult=true is returned. If the dry run fails, an error code is returned.
- false: The actual request is sent and no dry run is performed. The instance is deleted if the requirements are met. By default, false is returned for the parameter DryRunResult if you set DryRun to false.', example='false'),
  instanceIds?: string(name='InstanceIds', description='The ID of the cluster to be deleted.   
The value is a string in the JSON format.

This parameter is required.', example='[”ob ob3f6yhv9uxxxx“]'),
}

model DeleteInstancesResponseBody = {
  data?: {
    dryRunResult?: boolean(name='DryRunResult', description='The result of the dry-run request.
- If the DryRun parameter is set to true and the dry run succeeds, the DryRunResult parameter returns true. Otherwise, an error code is returned.
- If the DryRun parameter is set to false, no dry run is performed and the DryRunResult parameter returns false.', example='false'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-****-****-B3DB-A3DC0DE3C83E'),
}

model DeleteInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteInstancesResponseBody(name='body'),
}

/**
 * @summary You can call this operation to release an OceanBase cluster.
 *
 * @description Before you call this operation, ensure that the following requirements are met:
 * - The cluster is in the Running state.
 * - The cluster is a primary cluster and the billing method is pay-as-you-go.
 *
 * @param request DeleteInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteInstancesResponse
 */
async function deleteInstancesWithOptions(request: DeleteInstancesRequest, runtime: Util.RuntimeOptions): DeleteInstancesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.backupRetainMode)) {
    body['BackupRetainMode'] = request.backupRetainMode;
  }
  if (!Util.isUnset(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.instanceIds)) {
    body['InstanceIds'] = request.instanceIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteInstances',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to release an OceanBase cluster.
 *
 * @description Before you call this operation, ensure that the following requirements are met:
 * - The cluster is in the Running state.
 * - The cluster is a primary cluster and the billing method is pay-as-you-go.
 *
 * @param request DeleteInstancesRequest
 * @return DeleteInstancesResponse
 */
async function deleteInstances(request: DeleteInstancesRequest): DeleteInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteInstancesWithOptions(request, runtime);
}

model DeleteProjectRequest {
  id?: string(name='Id', description='This parameter is required.', example='np_4w3a****'),
}

model DeleteProjectResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: any(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='473469C7-XXXX-XXX-B3DB-A3DC0DE'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='24'),
}

model DeleteProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProjectResponseBody(name='body'),
}

/**
 * @summary 删除项目
 *
 * @param request DeleteProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProjectResponse
 */
async function deleteProjectWithOptions(request: DeleteProjectRequest, runtime: Util.RuntimeOptions): DeleteProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProject',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除项目
 *
 * @param request DeleteProjectRequest
 * @return DeleteProjectResponse
 */
async function deleteProject(request: DeleteProjectRequest): DeleteProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteProjectWithOptions(request, runtime);
}

model DeleteSecurityIpGroupRequest {
  instanceId?: string(name='InstanceId', description='The name of the IP address whitelist group.    
It must be 2 to 32 characters in length, start with a lowercase letter, end with a lowercase letter or digit, and contain only lowercase letters, digits, and underscores (_).

This parameter is required.', example='ob317v4uif****'),
  securityIpGroupName?: string(name='SecurityIpGroupName', description='The information of the deleted IP whitelist group.

This parameter is required.', example='paytest'),
}

model DeleteSecurityIpGroupResponseBody = {
  requestId?: string(name='RequestId', description='Example 1', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  securityIpGroup?: {
    instanceId?: string(name='InstanceId', example='ob317v4uif****'),
    securityIpGroupName?: string(name='SecurityIpGroupName', example='paytest'),
  }(name='SecurityIpGroup'),
}

model DeleteSecurityIpGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSecurityIpGroupResponseBody(name='body'),
}

/**
 * @summary The name of the deleted IP address whitelist group.
 *
 * @param request DeleteSecurityIpGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSecurityIpGroupResponse
 */
async function deleteSecurityIpGroupWithOptions(request: DeleteSecurityIpGroupRequest, runtime: Util.RuntimeOptions): DeleteSecurityIpGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.securityIpGroupName)) {
    body['SecurityIpGroupName'] = request.securityIpGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSecurityIpGroup',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The name of the deleted IP address whitelist group.
 *
 * @param request DeleteSecurityIpGroupRequest
 * @return DeleteSecurityIpGroupResponse
 */
async function deleteSecurityIpGroup(request: DeleteSecurityIpGroupRequest): DeleteSecurityIpGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSecurityIpGroupWithOptions(request, runtime);
}

model DeleteTagRequest {
  key?: string(name='Key', description='The name of the tag group.

This parameter is required.', example='Tag group 2'),
}

model DeleteTagResponseBody = {
  message?: string(name='Message', description='The tag group deletion result.', example='delete tag success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4C91F7BA-xxxx-xxxx-xxxx-846ECA1A9908'),
}

model DeleteTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTagResponseBody(name='body'),
}

/**
 * @summary You can call this operation to delete a tag group.
 *
 * @param request DeleteTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTagResponse
 */
async function deleteTagWithOptions(request: DeleteTagRequest, runtime: Util.RuntimeOptions): DeleteTagResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.key)) {
    body['Key'] = request.key;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTag',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to delete a tag group.
 *
 * @param request DeleteTagRequest
 * @return DeleteTagResponse
 */
async function deleteTag(request: DeleteTagRequest): DeleteTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTagWithOptions(request, runtime);
}

model DeleteTagValueRequest {
  key?: string(name='Key', description='The name of the tag group.

This parameter is required.', example='Tag group 1'),
  value?: string(name='Value', description='The name of the tag.

This parameter is required.', example='Tag 2'),
}

model DeleteTagValueResponseBody = {
  message?: string(name='Message', description='The tag deletion result.', example='delete tag-value success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4C91F7BA-xxxx-xxxx-xxxx-846ECA1A9908'),
}

model DeleteTagValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTagValueResponseBody(name='body'),
}

/**
 * @summary You can call this operation to delete a tag from a tag group.
 *
 * @param request DeleteTagValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTagValueResponse
 */
async function deleteTagValueWithOptions(request: DeleteTagValueRequest, runtime: Util.RuntimeOptions): DeleteTagValueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.key)) {
    body['Key'] = request.key;
  }
  if (!Util.isUnset(request.value)) {
    body['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTagValue',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to delete a tag from a tag group.
 *
 * @param request DeleteTagValueRequest
 * @return DeleteTagValueResponse
 */
async function deleteTagValue(request: DeleteTagValueRequest): DeleteTagValueResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTagValueWithOptions(request, runtime);
}

model DeleteTenantSecurityIpGroupRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  securityIpGroupName?: string(name='SecurityIpGroupName', description='The group name of the whitelist group of IP addresses.

It starts with lowercase letters and ends with lowercase letters or numbers. It can only contain lowercase letters, numbers, and underscores, and should be 2~32 characters in length.

This parameter is required.', example='paytest'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model DeleteTenantSecurityIpGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  securityIpGroup?: {
    instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
    securityIpGroupName?: string(name='SecurityIpGroupName', description='The name of the whitelist group.', example='paytest'),
    tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t4louaeei****'),
  }(name='SecurityIpGroup', description='The information of the whitelist group.'),
}

model DeleteTenantSecurityIpGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTenantSecurityIpGroupResponseBody(name='body'),
}

/**
 * @summary You can call this operation to delete the information on the whitelist group of the tenant.
 *
 * @param request DeleteTenantSecurityIpGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTenantSecurityIpGroupResponse
 */
async function deleteTenantSecurityIpGroupWithOptions(request: DeleteTenantSecurityIpGroupRequest, runtime: Util.RuntimeOptions): DeleteTenantSecurityIpGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.securityIpGroupName)) {
    body['SecurityIpGroupName'] = request.securityIpGroupName;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTenantSecurityIpGroup',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to delete the information on the whitelist group of the tenant.
 *
 * @param request DeleteTenantSecurityIpGroupRequest
 * @return DeleteTenantSecurityIpGroupResponse
 */
async function deleteTenantSecurityIpGroup(request: DeleteTenantSecurityIpGroupRequest): DeleteTenantSecurityIpGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTenantSecurityIpGroupWithOptions(request, runtime);
}

model DeleteTenantUsersRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='ob2mr3oae0****'),
  users?: string(name='Users', description='A list of usernames.

This parameter is required.', example='["testUser"]'),
}

model DeleteTenantUsersResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DeleteTenantUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTenantUsersResponseBody(name='body'),
}

/**
 * @summary You can call this operation to delete one or more database accounts.
 *
 * @param request DeleteTenantUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTenantUsersResponse
 */
async function deleteTenantUsersWithOptions(request: DeleteTenantUsersRequest, runtime: Util.RuntimeOptions): DeleteTenantUsersResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.users)) {
    body['Users'] = request.users;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTenantUsers',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to delete one or more database accounts.
 *
 * @param request DeleteTenantUsersRequest
 * @return DeleteTenantUsersResponse
 */
async function deleteTenantUsers(request: DeleteTenantUsersRequest): DeleteTenantUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTenantUsersWithOptions(request, runtime);
}

model DeleteTenantsRequest {
  instanceId?: string(name='InstanceId', description='You can call this operation to delete one or more tenants from an OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantIds?: string(name='TenantIds', description='```
http(s)://[Endpoint]/?Action=DeleteTenants
&TenantIds=["ob2mr3oae0****", "ob2mr3oae1****"]
&InstanceId=ob317v4uif****
&Common request parameters
```

This parameter is required.', example='["ob2mr3oae0****", "ob2mr3oae1****"]'),
}

model DeleteTenantsResponseBody = {
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenantIds?: [ string ](name='TenantIds'),
}

model DeleteTenantsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTenantsResponseBody(name='body'),
}

/**
 * @summary The return result of the request.
 *
 * @param request DeleteTenantsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTenantsResponse
 */
async function deleteTenantsWithOptions(request: DeleteTenantsRequest, runtime: Util.RuntimeOptions): DeleteTenantsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantIds)) {
    body['TenantIds'] = request.tenantIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTenants',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The return result of the request.
 *
 * @param request DeleteTenantsRequest
 * @return DeleteTenantsResponse
 */
async function deleteTenants(request: DeleteTenantsRequest): DeleteTenantsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTenantsWithOptions(request, runtime);
}

model DescribeAnomalySQLListRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The language of the returned data.   
Default value: CN for a China site and EN for an International site.', example='zh-CN'),
  dbName?: string(name='DbName', description='The name of the database.', example='testdb'),
  endTime?: string(name='EndTime', description='The end time of the time range for querying suspicious SQL statements.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-09-13T15:40:43Z'),
  filterCondition?: map[string]any(name='FilterCondition', description='The filter condition.   
> <br> - All fields in OceanBase Database support filtering. <br> - You can write the key-value pair of a parameter in a JSON string in the JSON format to filter the parameter.', example='{
  "UserName":testUser
}'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='obsd23j4f****'),
  nodeIp?: string(name='NodeIp', description='The IP address of the node.', example='i-bp19y05uq6xpacyqnlrc'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.    
- Start value: 1   
- Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of rows to return on each page.    
- Maximum value: 100   
- Default value: 10', example='10'),
  SQLId?: string(name='SQLId', description='SQLID.', example='8D6E84****0B8FB1823D199E2CA1****'),
  searchKeyWord?: string(name='SearchKeyWord', description='The search keyword.', example='update'),
  searchParameter?: string(name='SearchParameter', description='The search parameter.', example='cputime'),
  searchRule?: string(name='SearchRule', description='The search rule.   
Valid values: "=", ">", ">=", "<", and "<="', example='>'),
  searchValue?: string(name='SearchValue', description='The search value.', example='0.01'),
  sortColumn?: string(name='SortColumn', description='The sorted column.', example='cputime'),
  sortOrder?: string(name='SortOrder', description='The sorting rule.', example='desc'),
  startTime?: string(name='StartTime', description='The start time of the time range for querying suspicious SQL statements.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-06-13T15:40:43Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeAnomalySQLListShrinkRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The language of the returned data.   
Default value: CN for a China site and EN for an International site.', example='zh-CN'),
  dbName?: string(name='DbName', description='The name of the database.', example='testdb'),
  endTime?: string(name='EndTime', description='The end time of the time range for querying suspicious SQL statements.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-09-13T15:40:43Z'),
  filterConditionShrink?: string(name='FilterCondition', description='The filter condition.   
> <br> - All fields in OceanBase Database support filtering. <br> - You can write the key-value pair of a parameter in a JSON string in the JSON format to filter the parameter.', example='{
  "UserName":testUser
}'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='obsd23j4f****'),
  nodeIp?: string(name='NodeIp', description='The IP address of the node.', example='i-bp19y05uq6xpacyqnlrc'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.    
- Start value: 1   
- Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of rows to return on each page.    
- Maximum value: 100   
- Default value: 10', example='10'),
  SQLId?: string(name='SQLId', description='SQLID.', example='8D6E84****0B8FB1823D199E2CA1****'),
  searchKeyWord?: string(name='SearchKeyWord', description='The search keyword.', example='update'),
  searchParameter?: string(name='SearchParameter', description='The search parameter.', example='cputime'),
  searchRule?: string(name='SearchRule', description='The search rule.   
Valid values: "=", ">", ">=", "<", and "<="', example='>'),
  searchValue?: string(name='SearchValue', description='The search value.', example='0.01'),
  sortColumn?: string(name='SortColumn', description='The sorted column.', example='cputime'),
  sortOrder?: string(name='SortOrder', description='The sorting rule.', example='desc'),
  startTime?: string(name='StartTime', description='The start time of the time range for querying suspicious SQL statements.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-06-13T15:40:43Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeAnomalySQLListResponseBody = {
  anomalySQLList?: [ 
    {
      cpuTime?: float(name='CpuTime', description='The average CPU time, in ms.', example='50.13'),
      dbName?: string(name='DbName', description='The name of the database.', example='database1'),
      diagnosis?: string(name='Diagnosis', description='The diagnosis information.', example='Total number of executions = 80199, Average CPU time = 6.8 ms, Overall CPU utilization = 87%'),
      diagnosisRule?: string(name='DiagnosisRule', description='The diagnostic rule.', example='Utilization above threshold'),
      executions?: long(name='Executions', description='The number of executions.', example='89043'),
      key?: long(name='Key', description='The sequence number of the returned SQL statement.', example='1'),
      requestTime?: float(name='RequestTime', description='The request time, in ms.', example='50.00'),
      requestTimeUTCString?: string(name='RequestTimeUTCString', description='The request time in UTC +0.', example='2022-01-11T07:08:00Z'),
      SQLId?: string(name='SQLId', description='SQLID.', example='99E9D3BF****B486239E6C7BC79B****'),
      SQLText?: string(name='SQLText', description='The SQL text.', example='SELECT  ****   FROM ****   WHERE **** = ? AND **** = ?   ORDER BY **** ASC'),
      suggestion?: string(name='Suggestion', description='The suggestions.', example='Check your business scenarios, data distribution changes, request surges, and execution plan changes.'),
      userName?: string(name='UserName', description='The username.', example='tester'),
    }
  ](name='AnomalySQLList', description='The list of suspicious SQL statements.'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  totalCount?: long(name='TotalCount', description='The total count.', example='2'),
}

model DescribeAnomalySQLListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAnomalySQLListResponseBody(name='body'),
}

/**
 * @summary You can call this operation to obtain the list of SQL statements that may have performance problems according to the diagnostic system.
 *
 * @param tmpReq DescribeAnomalySQLListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAnomalySQLListResponse
 */
async function describeAnomalySQLListWithOptions(tmpReq: DescribeAnomalySQLListRequest, runtime: Util.RuntimeOptions): DescribeAnomalySQLListResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeAnomalySQLListShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.filterCondition)) {
    request.filterConditionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterCondition, 'FilterCondition', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    body['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.filterConditionShrink)) {
    body['FilterCondition'] = request.filterConditionShrink;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.nodeIp)) {
    body['NodeIp'] = request.nodeIp;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.SQLId)) {
    body['SQLId'] = request.SQLId;
  }
  if (!Util.isUnset(request.searchKeyWord)) {
    body['SearchKeyWord'] = request.searchKeyWord;
  }
  if (!Util.isUnset(request.searchParameter)) {
    body['SearchParameter'] = request.searchParameter;
  }
  if (!Util.isUnset(request.searchRule)) {
    body['SearchRule'] = request.searchRule;
  }
  if (!Util.isUnset(request.searchValue)) {
    body['SearchValue'] = request.searchValue;
  }
  if (!Util.isUnset(request.sortColumn)) {
    body['SortColumn'] = request.sortColumn;
  }
  if (!Util.isUnset(request.sortOrder)) {
    body['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAnomalySQLList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to obtain the list of SQL statements that may have performance problems according to the diagnostic system.
 *
 * @param request DescribeAnomalySQLListRequest
 * @return DescribeAnomalySQLListResponse
 */
async function describeAnomalySQLList(request: DescribeAnomalySQLListRequest): DescribeAnomalySQLListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAnomalySQLListWithOptions(request, runtime);
}

model DescribeAvailableCpuResourceRequest {
  instanceId?: string(name='InstanceId', description='The CPU resources available.

This parameter is required.', example='ob317v4uif****'),
  modifyType?: string(name='ModifyType', description='```
http(s)://[Endpoint]/?Action=DescribeAvailableCpuResource
&InstanceId=ob317v4uif****
&TenantId=ob2mr3oae0****
&ModifyType=update
&Common request parameters
```', example='update'),
  tenantId?: string(name='TenantId', description='The operation that you want to perform.   
Set the value to **DescribeAvailableCpuResource**.', example='ob2mr3oae0****'),
}

model DescribeAvailableCpuResourceResponseBody = {
  data?: [ 
    {
      comment?: string(name='Comment', example='UnitNum.RejectComment.Storage'),
      maxCpu?: long(name='MaxCpu', example='10'),
      minCpu?: long(name='MinCpu', example='2'),
      reviewCode?: string(name='ReviewCode', example='UnitNum.Change.Accept'),
      unitNum?: long(name='UnitNum', example='2'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeAvailableCpuResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableCpuResourceResponseBody(name='body'),
}

/**
 * @summary The maximum number of CPU cores per resource unit.
 *
 * @param request DescribeAvailableCpuResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailableCpuResourceResponse
 */
async function describeAvailableCpuResourceWithOptions(request: DescribeAvailableCpuResourceRequest, runtime: Util.RuntimeOptions): DescribeAvailableCpuResourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.modifyType)) {
    body['ModifyType'] = request.modifyType;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableCpuResource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The maximum number of CPU cores per resource unit.
 *
 * @param request DescribeAvailableCpuResourceRequest
 * @return DescribeAvailableCpuResourceResponse
 */
async function describeAvailableCpuResource(request: DescribeAvailableCpuResourceRequest): DescribeAvailableCpuResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableCpuResourceWithOptions(request, runtime);
}

model DescribeAvailableMemResourceRequest {
  cpuNum?: long(name='CpuNum', description='The number of CPU cores.

This parameter is required.', example='14'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.', example='ob2mr3oae0****'),
  unitNum?: long(name='UnitNum', description='The number of resource distribution nodes in the tenant.   
The number is determined by the deployment mode of the cluster. If the cluster is deployed in 2-2-2 mode, the maximum number of resource distribution nodes is 2.

This parameter is required.', example='2'),
}

model DescribeAvailableMemResourceResponseBody = {
  data?: {
    maxMem?: long(name='MaxMem', description='The maximum memory size for each resource unit, in GB.', example='10'),
    minMem?: long(name='MinMem', description='The minimum memory size required for each resource unit, in GB.', example='5'),
    safeMem?: string(name='SafeMem', description='The maximum allowed memory usage, in GB.', example='10.0'),
    usedMem?: long(name='UsedMem', description='The number of resource units in the tenant.', example='2'),
  }(name='Data', description='The available memory size.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeAvailableMemResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableMemResourceResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the available memory resource of an OceanBase Database tenant.
 *
 * @param request DescribeAvailableMemResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailableMemResourceResponse
 */
async function describeAvailableMemResourceWithOptions(request: DescribeAvailableMemResourceRequest, runtime: Util.RuntimeOptions): DescribeAvailableMemResourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cpuNum)) {
    body['CpuNum'] = request.cpuNum;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.unitNum)) {
    body['UnitNum'] = request.unitNum;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableMemResource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the available memory resource of an OceanBase Database tenant.
 *
 * @param request DescribeAvailableMemResourceRequest
 * @return DescribeAvailableMemResourceResponse
 */
async function describeAvailableMemResource(request: DescribeAvailableMemResourceRequest): DescribeAvailableMemResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableMemResourceWithOptions(request, runtime);
}

model DescribeAvailableSpecRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob317v4uif****'),
  spec?: string(name='Spec', example='oceanbase.cluster.cd8.xlarge'),
  upgradeType?: string(name='UpgradeType', description='This parameter is required.', example='upgradespec'),
}

model DescribeAvailableSpecResponseBody = {
  data?: {
    availableSpecifications?: [ 
      {
        diskSizeRange?: {
          max?: long(name='Max', example='40000'),
          min?: long(name='Min', example='1000'),
          step?: long(name='Step', example='5'),
        }(name='DiskSizeRange'),
        diskTypes?: [ string ](name='DiskTypes'),
        instanceClass?: string(name='InstanceClass', example='4C16GB'),
        logDiskSizeRange?: {
          max?: long(name='Max', example='4000'),
          min?: long(name='Min', example='100'),
          step?: long(name='Step', example='5'),
        }(name='LogDiskSizeRange'),
        nodeNum?: [ int32 ](name='NodeNum'),
        spec?: string(name='Spec', example='oceanbase.cluster.cd8.xlarge'),
      }
    ](name='AvailableSpecifications'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeAvailableSpecResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableSpecResponseBody(name='body'),
}

/**
 * @summary 获取集群变配页可选配置
 *
 * @param request DescribeAvailableSpecRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailableSpecResponse
 */
async function describeAvailableSpecWithOptions(request: DescribeAvailableSpecRequest, runtime: Util.RuntimeOptions): DescribeAvailableSpecResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.spec)) {
    body['Spec'] = request.spec;
  }
  if (!Util.isUnset(request.upgradeType)) {
    body['UpgradeType'] = request.upgradeType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableSpec',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取集群变配页可选配置
 *
 * @param request DescribeAvailableSpecRequest
 * @return DescribeAvailableSpecResponse
 */
async function describeAvailableSpec(request: DescribeAvailableSpecRequest): DescribeAvailableSpecResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableSpecWithOptions(request, runtime);
}

model DescribeAvailableZoneRequest {
  cpuArch?: string(name='CpuArch', example='x86'),
  deployType?: string(name='DeployType', example='multiple'),
  instanceType?: string(name='InstanceType', description='This parameter is required.', example='cluster'),
  obVersion?: string(name='ObVersion', example='3.2.4.4'),
  series?: string(name='Series', example='normal'),
  spec?: string(name='Spec', example='oceanbase.cluster.cd8.xlarge'),
}

model DescribeAvailableZoneResponseBody = {
  data?: {
    availableZones?: [ 
      {
        channel?: string(name='Channel', example='PUBLIC'),
        cpuArch?: string(name='CpuArch', example='x86'),
        deployType?: string(name='DeployType', example='multiple'),
        instanceType?: string(name='InstanceType', example='cluster'),
        region?: string(name='Region', example='cn-hangzhou'),
        series?: string(name='Series', example='normal'),
        supportSpecifications?: [ 
          {
            diskSizeRange?: {
              max?: long(name='Max', example='40000'),
              min?: long(name='Min', example='1000'),
              step?: long(name='Step', example='5'),
            }(name='DiskSizeRange'),
            diskTypes?: [ string ](name='DiskTypes'),
            instanceClass?: string(name='InstanceClass', example='4C16GB'),
            spec?: string(name='Spec', example='oceanbase.cluster.cd8.xlarge'),
            supportEngineVersions?: [ 
              {
                obVersion?: string(name='ObVersion', example='3.2.4.4'),
                supportIsolationOptimization?: boolean(name='SupportIsolationOptimization', example='true'),
                supportReplicaModes?: [ string ](name='SupportReplicaModes'),
              }
            ](name='SupportEngineVersions'),
          }
        ](name='SupportSpecifications'),
        zones?: string(name='Zones', example='cn-hangzhou-h,cn-hangzhou-i,cn-hangzhou-j'),
      }
    ](name='AvailableZones'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeAvailableZoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableZoneResponseBody(name='body'),
}

/**
 * @summary 获取集群售卖页可选配置
 *
 * @param request DescribeAvailableZoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailableZoneResponse
 */
async function describeAvailableZoneWithOptions(request: DescribeAvailableZoneRequest, runtime: Util.RuntimeOptions): DescribeAvailableZoneResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cpuArch)) {
    body['CpuArch'] = request.cpuArch;
  }
  if (!Util.isUnset(request.deployType)) {
    body['DeployType'] = request.deployType;
  }
  if (!Util.isUnset(request.instanceType)) {
    body['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.obVersion)) {
    body['ObVersion'] = request.obVersion;
  }
  if (!Util.isUnset(request.series)) {
    body['Series'] = request.series;
  }
  if (!Util.isUnset(request.spec)) {
    body['Spec'] = request.spec;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableZone',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取集群售卖页可选配置
 *
 * @param request DescribeAvailableZoneRequest
 * @return DescribeAvailableZoneResponse
 */
async function describeAvailableZone(request: DescribeAvailableZoneRequest): DescribeAvailableZoneResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableZoneWithOptions(request, runtime);
}

model DescribeBackupEncryptedStringRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob4wibn0abo9uo'),
  tenantId?: string(name='TenantId', description='This parameter is required.', example='txxxxxxx'),
}

model DescribeBackupEncryptedStringResponseBody = {
  data?: {
    backupInfoJson?: string(name='BackupInfoJson'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeBackupEncryptedStringResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupEncryptedStringResponseBody(name='body'),
}

/**
 * @summary DescribeBackupEncryptedString
 *
 * @param request DescribeBackupEncryptedStringRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupEncryptedStringResponse
 */
async function describeBackupEncryptedStringWithOptions(request: DescribeBackupEncryptedStringRequest, runtime: Util.RuntimeOptions): DescribeBackupEncryptedStringResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupEncryptedString',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary DescribeBackupEncryptedString
 *
 * @param request DescribeBackupEncryptedStringRequest
 * @return DescribeBackupEncryptedStringResponse
 */
async function describeBackupEncryptedString(request: DescribeBackupEncryptedStringRequest): DescribeBackupEncryptedStringResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupEncryptedStringWithOptions(request, runtime);
}

model DescribeBackupSetDownloadLinkRequest {
  downloadTaskId?: string(name='DownloadTaskId', description='The ID of the download task corresponding to the target backup set.

This parameter is required.', example='1000002'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
}

model DescribeBackupSetDownloadLinkResponseBody = {
  data?: {
    backupRestorableTime?: string(name='BackupRestorableTime', description='The restorable time of the backup set.', example='yyyy-MM-dd HH:mm:ss'),
    backupSetId?: string(name='BackupSetId', description='The ID of the target backup set.', example='bak-4n****gacpa8'),
    downloadTaskCreateTime?: string(name='DownloadTaskCreateTime', description='The time when the download task corresponding to the target backup set was created.', example='2020-05-22T17:04:18'),
    downloadTaskId?: long(name='DownloadTaskId', description='The ID of the download task corresponding to the target backup set.', example='1000002'),
    downloadTaskStatus?: string(name='DownloadTaskStatus', description='The status of the download task corresponding to the target backup set.', example='RUNNING'),
    internalUrl?: string(name='InternalUrl', description='The internal URL.', example='http://bucket.oss-region-internal.aliyuncs.com/xxxxx'),
    urlAliveTime?: long(name='UrlAliveTime', description='The validity period of the URL, in seconds.', example='3600'),
    urlExpiredTime?: string(name='UrlExpiredTime', description='The expiration time of the URL.', example='2024-01-04 17:39:49'),
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeBackupSetDownloadLinkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupSetDownloadLinkResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the link for downloading a backup set of OceanBase Database.
 *
 * @param request DescribeBackupSetDownloadLinkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupSetDownloadLinkResponse
 */
async function describeBackupSetDownloadLinkWithOptions(request: DescribeBackupSetDownloadLinkRequest, runtime: Util.RuntimeOptions): DescribeBackupSetDownloadLinkResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.downloadTaskId)) {
    body['DownloadTaskId'] = request.downloadTaskId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupSetDownloadLink',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the link for downloading a backup set of OceanBase Database.
 *
 * @param request DescribeBackupSetDownloadLinkRequest
 * @return DescribeBackupSetDownloadLinkResponse
 */
async function describeBackupSetDownloadLink(request: DescribeBackupSetDownloadLinkRequest): DescribeBackupSetDownloadLinkResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupSetDownloadLinkWithOptions(request, runtime);
}

model DescribeCharsetRequest {
  instanceId?: string(name='InstanceId'),
  series?: string(name='Series', description='实例的系列  - normal（默认）：标准集群版（云盘）  - normal_ssd：标准集群版（本地盘） - history：历史库集群版。', example='normal'),
  tenantMode?: string(name='TenantMode', description='The return result of the request.

This parameter is required.', example='Oracle'),
}

model DescribeCharsetResponseBody = {
  charset?: [ 
    {
      charset?: string(name='Charset', description='DescribeCharset', example='utf8'),
      collations?: [ string ](name='Collations'),
    }
  ](name='Charset', description='```
http(s)://[Endpoint]/?Action=DescribeCharset
&TenantMode=Oracle
&Common request parameters
```'),
  requestId?: string(name='RequestId', description='The operation that you want to perform.   
Set the value to **DescribeCharset**.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeCharsetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCharsetResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the character sets of an OceanBase Database tenant.
 *
 * @param request DescribeCharsetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCharsetResponse
 */
async function describeCharsetWithOptions(request: DescribeCharsetRequest, runtime: Util.RuntimeOptions): DescribeCharsetResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.series)) {
    body['Series'] = request.series;
  }
  if (!Util.isUnset(request.tenantMode)) {
    body['TenantMode'] = request.tenantMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCharset',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the character sets of an OceanBase Database tenant.
 *
 * @param request DescribeCharsetRequest
 * @return DescribeCharsetResponse
 */
async function describeCharset(request: DescribeCharsetRequest): DescribeCharsetResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCharsetWithOptions(request, runtime);
}

model DescribeDataBackupSetRequest {
  backupObjectType?: string(name='BackupObjectType', example='tenant'),
  endTime?: string(name='EndTime', example='2023-01-06T15:59:59Z'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob317v4uif****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  startTime?: string(name='StartTime', example='2022-12-27T16:00:00Z'),
  status?: string(name='Status', example='DONE'),
}

model DescribeDataBackupSetResponseBody = {
  data?: [ 
    {
      backupObjectType?: string(name='BackupObjectType', example='cluster'),
      backupObjects?: [ 
        {
          clusterName?: string(name='ClusterName', example='test-****way'),
          databaseTablesList?: [ 
            {
              database?: string(name='Database', example='sms_pre'),
              tables?: [ string ](name='Tables'),
            }
          ](name='DatabaseTablesList'),
          tenantName?: string(name='TenantName', example='ob2mr3oae0****'),
        }
      ](name='BackupObjects'),
      backupResults?: [ 
        {
          clusterName?: string(name='ClusterName', example='container-opa-****-02'),
          tableBackupResults?: [ 
            {
              database?: string(name='Database', example='order_ce****_online'),
              message?: string(name='Message', example='Create tag success'),
              status?: string(name='Status', example='RUNNING'),
              table?: string(name='Table', example='tr_sale_order_****'),
            }
          ](name='TableBackupResults'),
          tenantName?: string(name='TenantName', example='ob2mr3oae0****'),
        }
      ](name='BackupResults'),
      checkpoint?: string(name='Checkpoint', example='2023-05-15T07:11:08Z'),
      dataSize?: int32(name='DataSize', example='31457280'),
      dataVersion?: int32(name='DataVersion', example='1678847020352'),
      downloadTaskId?: long(name='DownloadTaskId', example='100***012'),
      downloadTaskStatus?: string(name='DownloadTaskStatus', example='not_exist'),
      endTime?: string(name='EndTime', example='2023-04-13T03:38:10Z'),
      method?: string(name='Method', example='logical'),
      policy?: string(name='Policy', example='automated'),
      progress?: string(name='Progress', example='52'),
      setId?: int32(name='SetId', example='imm-test-set-cb****ee-b7d7-11ed-956f-****3e10bd70'),
      startTime?: string(name='StartTime', example='2020-05-22T17:04:18'),
      status?: string(name='Status', example='RUNNING'),
      storageClass?: string(name='StorageClass', example='standard'),
      type?: string(name='Type', example='manual'),
      validity?: string(name='Validity', example='VALID'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  totalCount?: int32(name='TotalCount', example='2'),
}

model DescribeDataBackupSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDataBackupSetResponseBody(name='body'),
}

/**
 * @summary 查询备份集信息
 *
 * @param request DescribeDataBackupSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDataBackupSetResponse
 */
async function describeDataBackupSetWithOptions(request: DescribeDataBackupSetRequest, runtime: Util.RuntimeOptions): DescribeDataBackupSetResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.backupObjectType)) {
    body['BackupObjectType'] = request.backupObjectType;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDataBackupSet',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询备份集信息
 *
 * @param request DescribeDataBackupSetRequest
 * @return DescribeDataBackupSetResponse
 */
async function describeDataBackupSet(request: DescribeDataBackupSetRequest): DescribeDataBackupSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDataBackupSetWithOptions(request, runtime);
}

model DescribeDatabasesRequest {
  databaseName?: string(name='DatabaseName', description='The name of the database.    
You cannot use reserved keywords, such as test and mysql.', example='sms_pre'),
  instanceId?: string(name='InstanceId', description='The ID of the cluster.', example='ob****n0abo9uo'),
  pageNumber?: int32(name='PageNumber', description='The number of the page returned.  
- Start value: 1   
- Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of rows returned on each page.  
- Maximum value: 100.  
- Default value: 10', example='10'),
  searchKey?: string(name='SearchKey', description='The search keyword.', example='pay'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.', example='ob2mr3oae0****'),
  withTables?: boolean(name='WithTables', description='Specifies whether to return the information about tables in the database.
Default value: false. 
> The operation may time out if the database contains a large number of tables.', example='true'),
}

model DescribeDatabasesResponseBody = {
  databases?: [ 
    {
      collation?: string(name='Collation', description='The collation.', example='utf8mb4_general_ci'),
      createTime?: string(name='CreateTime', description='The time when the database was created.', example='2022-02-21 15:41:06'),
      dataSize?: double(name='DataSize', description='The actual data size, in GB. 
>Notice: This parameter is no longer used in later versions. RequiredSize is used instead.', example='5.67 GB'),
      databaseName?: string(name='DatabaseName', description='The name of the database.', example='sms_pre'),
      dbType?: string(name='DbType', description='The database type.', example='mysql'),
      description?: string(name='Description', description='The description of the database.', example='test db'),
      encoding?: string(name='Encoding', description='The encoding standard of the database. Encoding standards such as utf8mb4 and GBK are supported.', example='utf8mb4'),
      instanceId?: string(name='InstanceId', description='The ID of the cluster to which the tenant belongs.', example='obsdh2f****'),
      requiredSize?: double(name='RequiredSize', description='The storage space required, in GB.', example='5.67 GB'),
      status?: string(name='Status', description='The status of the database. Valid values:    
- ONLINE: The database is running.  
- DELETING: The database is being deleted.', example='ONLINE'),
      tables?: [ 
        {
          tableName?: string(name='TableName', description='The name of the database table.', example='testTables'),
        }
      ](name='Tables', description='The list of database tables.'),
      tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t33h8y08k****'),
      tenantName?: string(name='TenantName', description='The name of the tenant.', example='tenantABC'),
      users?: [ 
        {
          privileges?: string(name='Privileges', description='If you have granted custom privileges on the database, this parameter indicates the custom privileges, separated by commas (,). Otherwise, no data is returned for this parameter.', example='select,delete,update'),
          role?: string(name='Role', description='The role of the account.    
In MySQL mode, a role is a database-level role. Valid values:  
- ReadWrite: a role that has the read and write privileges, namely ALL PRIVILEGES.  
- ReadOnly: a role that has only the read-only privilege SELECT.   
- DDL: a role that has the DDL privileges such as CREATE, DROP, ALTER, SHOW VIEW, and CREATE VIEW.   
- DML: a role that has the DML privileges such as SELECT, INSERT, UPDATE, DELETE, and SHOW VIEW.', example='ReadOnly'),
          userName?: string(name='UserName', description='The name of the account.', example='user_pay_ro'),
          userType?: string(name='UserType', description='The type of the account. Valid values:  
- Admin: the super administrator account. 
- Normal: a general account.', example='Normal'),
        }
      ](name='Users', description='The list of accounts that are granted privileges on this database.'),
    }
  ](name='Databases', description='The list of databases in the tenant.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  totalCount?: int32(name='TotalCount', description='The total number of databases in the tenant.', example='1'),
}

model DescribeDatabasesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDatabasesResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query databases in a tenant.
 *
 * @param request DescribeDatabasesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDatabasesResponse
 */
async function describeDatabasesWithOptions(request: DescribeDatabasesRequest, runtime: Util.RuntimeOptions): DescribeDatabasesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.databaseName)) {
    body['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.searchKey)) {
    body['SearchKey'] = request.searchKey;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.withTables)) {
    body['WithTables'] = request.withTables;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDatabases',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query databases in a tenant.
 *
 * @param request DescribeDatabasesRequest
 * @return DescribeDatabasesResponse
 */
async function describeDatabases(request: DescribeDatabasesRequest): DescribeDatabasesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDatabasesWithOptions(request, runtime);
}

model DescribeInstanceRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.
- Pages start from page 1.
- Default value: 1.', example='1'),
}

model DescribeInstanceResponseBody = {
  instance?: {
    allowCreateProxySqlFirewallRule?: boolean(name='AllowCreateProxySqlFirewallRule', description='Indicates whether the OceanBase Database Proxy (ODP) SQL firewall is supported.', example='false'),
    allowModifyInternetAddressConnectionLimit?: boolean(name='AllowModifyInternetAddressConnectionLimit', description='Indicates whether the maximum number of public connections can be modified.', example='false'),
    autoRenewal?: boolean(name='AutoRenewal', description='Indicates whether automatic renewal is enabled. 

This parameter is valid only for clusters whose billing methods are set to PREPAY.', example='true'),
    autoUpgradeObVersion?: boolean(name='AutoUpgradeObVersion', description='Indicates whether automatic upgrade of the OBServer version is enabled.', example='true'),
    availableZones?: [ string ](name='AvailableZones', description='The list of zones.'),
    cpuArchitecture?: string(name='CpuArchitecture', description='The CPU architecture of the cluster.', example='X86'),
    createTime?: string(name='CreateTime', description='The time in UTC when the cluster was created.', example='2021-10-19T07:13:41Z'),
    dataDiskAutoScale?: boolean(name='DataDiskAutoScale', description='Specifies whether to enable automatic scaling of the data disk.
> <br>This parameter is deprecated.', example='-'),
    dataDiskAutoScaleConfig?: {
      autoScale?: boolean(name='AutoScale', description='Specifies whether to enable the automatic scaling of the data disk.', example='true'),
      maxDiskSize?: long(name='MaxDiskSize', description='The maximum size of the disk, in GB.', example='80000'),
      scaleStepInMerge?: long(name='ScaleStepInMerge', description='The size of scaling step during a major compaction.', example='100'),
      scaleStepInNormal?: long(name='ScaleStepInNormal', description='The size of scaling step during daily use.', example='50'),
      upperMergeThreshold?: long(name='UpperMergeThreshold', description='The maximum usage of the data disk, in percentage, that triggers the scaling of the data disk for major compactions.', example='90'),
      upperScaleStep?: string(name='UpperScaleStep', description='The step size of the scale-out.', example='5'),
      upperScaleStrategy?: string(name='UpperScaleStrategy', description='The scale-out strategy. Valid values: RAW and PERCENTAGE.', example='RAW'),
      upperThreshold?: long(name='UpperThreshold', description='The maximum usage of the data disk, in percentage, that triggers the scaling of the data disk for daily use.', example='80'),
      upperbound?: long(name='Upperbound', description='The maximum space, in GB, to which the data disk can be scaled.', example='16'),
    }(name='DataDiskAutoScaleConfig', description='Specifies parameters for the automatic scaling of the data disk.'),
    dataMergeTime?: string(name='DataMergeTime', description='The time when the major compaction of cluster data is performed.', example='02:00'),
    deployMode?: string(name='DeployMode', description='The data replica distribution mode of the cluster. Valid values: 
- n: indicates the single-IDC mode. 
- n-n: indicates the dual-IDC mode. 
- n-n-n: indicates the multi-IDC mode. 

> <br>The integer n represents the number of OBServer nodes in each IDC.', example='1-1-1'),
    deployType?: string(name='DeployType', description='The deployment type of the cluster. Valid values:  
- multiple: multi-IDC deployment   
- single: single-IDC deployment   
- dual: dual-IDC deployment', example='multiple'),
    diskType?: string(name='DiskType', description='The type of the storage disk where the cluster is deployed. 

The default value is cloud_essd_pl1, which indicates an ESSD cloud disk.', example='cloud_essd_pl1'),
    enableIsolationOptimization?: boolean(name='EnableIsolationOptimization', description='Specifies whether to enable isolation optimization.', example='false'),
    enableProxyService?: boolean(name='EnableProxyService', description='Specifies whether to enable the proxy service.
- true
- false', example='true'),
    enableReadOnlyReplica?: boolean(name='EnableReadOnlyReplica', description='Indicates whether read-only replicas are supported.', example='true'),
    enableReadOnlyReplicaManagement?: boolean(name='EnableReadOnlyReplicaManagement', description='Indicates whether read-only replicas can be purchased for the cluster.', example='false'),
    enableUpgradeLogDisk?: boolean(name='EnableUpgradeLogDisk', description='Indicates whether the log disk specifications can be upgraded.', example='false'),
    exclusiveUnitNumLimit?: int32(name='ExclusiveUnitNumLimit', description='The maximum number of units of the proxy service in exclusive mode.', example='1'),
    expireTime?: string(name='ExpireTime', description='The time in UTC when the cluster expires.', example='2021-10-17T16:00:00Z'),
    inTempCapacityStatus?: boolean(name='InTempCapacityStatus', description='Specifies whether to indicate the temporary status of the capacity.', example='false'),
    instanceClass?: string(name='InstanceClass', description='The specifications of the cluster.  You can specify one of the following four plans:    
- 8C32G: indicates 8 CPU cores and 32 GB of memory. 
- 14C70G: indicates 14 CPU cores and 70 GB of memory. 
- 30C180G: indicates 30 CPU cores and 180 GB of memory. 
- 62C400G: indicates 62 CPU cores and 400 GB of memory.', example='14C70G'),
    instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
    instanceName?: string(name='InstanceName', description='The name of the OceanBase cluster.', example='ob4test'),
    instanceRole?: string(name='InstanceRole', description='The role of the instance.', example='NORMAL'),
    isLatestObVersion?: boolean(name='IsLatestObVersion', description='Indicates whether the OBServer version is the latest.', example='true'),
    isTrustEcs?: boolean(name='IsTrustEcs', description='Indicates whether trusted ECS instances are used.', example='true'),
    isolationOptimization?: boolean(name='IsolationOptimization', description='Specifies whether to enable the control group feature.', example='false'),
    maintainTime?: string(name='MaintainTime', description='The period in UTC for the daily routine maintenance of the cluster.', example='19:00Z-20:00Z'),
    nodeNum?: string(name='NodeNum', description='The number of nodes in the cluster. If the cluster is deployed in n-n-n mode, the number of nodes in the cluster equals n × 3.', example='6'),
    obRpmVersion?: string(name='ObRpmVersion', description='The detailed information of the OBServer version.', example='2.2.77-20210526202046'),
    payType?: string(name='PayType', description='The billing method of the OceanBase cluster. Valid values: 
- PREPAY: the subscription billing method. 
- POSTPAY: the pay-as-you-go billing method.', example='PREPAY'),
    primaryInstance?: string(name='PrimaryInstance', description='The ID of the primary cluster.', example='ob3h8ytroxxxxx'),
    primaryRegion?: string(name='PrimaryRegion', description='The region of the primary cluster.', example='cn-hangzhou'),
    proxyClusterId?: string(name='ProxyClusterId', description='The ID of the proxy cluster.
> This parameter returns a value only if you set the **EnableProxyService** parameter to true.', example='proxy-56****a6tg2o'),
    proxyServiceStatus?: string(name='ProxyServiceStatus', description='The status of the proxy service.', example='ONLINE'),
    readOnlyResource?: {
      capacityUnit?: {
        maxCapacityUnit?: int32(name='MaxCapacityUnit', description='The maximum number of capacity units.', example='4'),
        minCapacityUnit?: int32(name='MinCapacityUnit', description='The minimum number of capacity units.', example='1'),
        usedCapacityUnit?: string(name='UsedCapacityUnit', description='The number of used capacity units.', example='2'),
      }(name='CapacityUnit', description='The information about capacity units.'),
      cpu?: {
        originalTotalCpu?: long(name='OriginalTotalCpu', description='The number of original CPU cores in the cluster.', example='14'),
        totalCpu?: long(name='TotalCpu', description='The total number of CPU cores of the cluster.', example='14'),
        unitCpu?: long(name='UnitCpu', description='The number of CPU cores of each replica node in the cluster.', example='10'),
        usedCpu?: long(name='UsedCpu', description='The number of CPU cores used by the cluster.', example='10'),
      }(name='Cpu', description='The information about the CPU resources of the cluster.'),
      diskSize?: {
        dataUsedSize?: double(name='DataUsedSize', description='The size of the data disk, in GB.', example='200'),
        maxDiskSize?: double(name='MaxDiskSize', description='The maximum disk size that can be created.', example='80000'),
        maxDiskUsedObServer?: [ string ](name='MaxDiskUsedObServer', description='The maximum disk usage of the OBServer node.'),
        maxDiskUsedPercent?: double(name='MaxDiskUsedPercent', description='The maximum disk usage, in percentage.', example='0.14'),
        originalTotalDiskSize?: long(name='OriginalTotalDiskSize', description='The original size of the disk.', example='200'),
        totalDiskSize?: long(name='TotalDiskSize', description='The total storage space of the cluster, in GB.', example='200'),
        unitDiskSize?: long(name='UnitDiskSize', description='The storage space of each replica node in the cluster, in GB.', example='200'),
        usedDiskSize?: long(name='UsedDiskSize', description='The size of used storage space of the cluster, in GB.', example='100'),
      }(name='DiskSize', description='The information about the storage resources of the cluster.'),
      logDiskSize?: {
        logAssignedSize?: string(name='LogAssignedSize', description='The allocated disk space for log storage, in GB.', example='0.0'),
        maxLogAssignedObServer?: [ string ](name='MaxLogAssignedObServer', description='The maximum storage space allocated for.'),
        maxLogAssignedPercent?: string(name='MaxLogAssignedPercent', description='The maximum percentage of space allocated for log storage.', example='6.68'),
        totalDiskSize?: long(name='TotalDiskSize', description='The information about the log disk space of the cluster.', example='400'),
        unitDiskSize?: long(name='UnitDiskSize', description='The log disk space of each replica node in the cluster, in GB.', example='200'),
      }(name='LogDiskSize', description='The information about the log disk space of the cluster.'),
      memory?: {
        originalTotalMemory?: long(name='OriginalTotalMemory', description='The original memory size of the cluster.', example='72'),
        totalMemory?: long(name='TotalMemory', description='The total memory size of the cluster, in GB.', example='70'),
        unitMemory?: long(name='UnitMemory', description='The memory size of each replica node in the cluster, in GB.', example='10'),
        usedMemory?: long(name='UsedMemory', description='The size of memory used by the cluster, in GB.', example='10'),
      }(name='Memory', description='The information about the memory resources of the cluster.'),
      unitCount?: long(name='UnitCount', description='The number of resource units in the cluster.', example='1'),
    }(name='ReadOnlyResource', description='The information about cluster resources.'),
    replicaMode?: string(name='ReplicaMode', description='The number of full-featured replicas. Return value: 3 or 2.
- 3: three full-featured replicas.
- 2: two full-featured replicas.

An OceanBase cluster deployed in three-zone mode supports only three full-featured replicas. An OceanBase cluster deployed in two-zone mode supports only two full-featured replicas. An OceanBase cluster deployed in one single zone supports two or three full-featured replicas.', example='2F1A'),
    resource?: {
      capacityUnit?: {
        maxCapacityUnit?: int32(name='MaxCapacityUnit', description='The maximum number of capacity units.', example='4'),
        minCapacityUnit?: int32(name='MinCapacityUnit', description='The minimum number of capacity units.', example='1'),
        usedCapacityUnit?: string(name='UsedCapacityUnit', description='The number of used capacity units.', example='2'),
      }(name='CapacityUnit', description='The information about capacity units.'),
      cpu?: {
        originalTotalCpu?: long(name='OriginalTotalCpu', description='The number of original CPU cores in the cluster.', example='14'),
        totalCpu?: long(name='TotalCpu', description='The total number of CPU cores of the cluster.', example='14'),
        unitCpu?: long(name='UnitCpu', description='The number of CPU cores of each replica node in the cluster.', example='10'),
        usedCpu?: long(name='UsedCpu', description='The number of CPU cores used in the cluster.', example='10'),
      }(name='Cpu', description='The information about the CPU resources of the cluster.'),
      diskSize?: {
        dataUsedSize?: double(name='DataUsedSize', description='The size of the data disk, in GB.', example='200'),
        maxDiskSize?: double(name='MaxDiskSize', description='The maximum disk size that can be created.', example='80000'),
        maxDiskUsedObServer?: [ string ](name='MaxDiskUsedObServer', description='The maximum disk usage of the OBServer node.'),
        maxDiskUsedPercent?: double(name='MaxDiskUsedPercent', description='The maximum disk usage, in percentage.', example='0.14'),
        originalTotalDiskSize?: long(name='OriginalTotalDiskSize', description='The original size of the disk.', example='200'),
        totalDiskSize?: long(name='TotalDiskSize', description='The total storage space of the cluster, in GB.', example='200'),
        unitDiskSize?: long(name='UnitDiskSize', description='The storage space of each replica node in the cluster, in GB.', example='200'),
        usedDiskSize?: long(name='UsedDiskSize', description='The size of used storage space of the cluster, in GB.', example='100'),
      }(name='DiskSize', description='The information about the storage resources of the cluster.'),
      logDiskSize?: {
        logAssignedSize?: string(name='LogAssignedSize', description='The allocated disk space for log storage, in GB.', example='0.0'),
        maxLogAssignedObServer?: [ string ](name='MaxLogAssignedObServer', description='The maximum storage space allocated for.'),
        maxLogAssignedPercent?: string(name='MaxLogAssignedPercent', description='The maximum percentage of space allocated for log storage.', example='6.68'),
        originalTotalDiskSize?: int32(name='OriginalTotalDiskSize', description='The original size of the disk.', example='200'),
        totalDiskSize?: long(name='TotalDiskSize', description='The total log disk space of the cluster, in GB.', example='400'),
        unitDiskSize?: long(name='UnitDiskSize', description='The log disk space of each replica node in the cluster. Unit: GB.', example='200'),
      }(name='LogDiskSize', description='The information about the log disk space of the cluster.'),
      memory?: {
        originalTotalMemory?: long(name='OriginalTotalMemory', description='The original memory size of the cluster, in GB.', example='72'),
        totalMemory?: long(name='TotalMemory', description='The total memory size of the cluster, in GB.', example='70'),
        unitMemory?: long(name='UnitMemory', description='The memory size of each replica node in the cluster, in GB.', example='10'),
        usedMemory?: long(name='UsedMemory', description='The size of used memory in the cluster, in GB.', example='10'),
      }(name='Memory', description='The information about the memory resources of the cluster.'),
      unitCount?: long(name='UnitCount', description='The number of resource units in the cluster.', example='1'),
    }(name='Resource', description='The information about cluster resources.'),
    series?: string(name='Series', description='The series of the instance. Valid values:

- normal: Standard Cluster Edition (Cloud Disk). This is the default value.

- normal_ssd: Standard Cluster Edition (Local Disk)

- history: History Database Cluster Edition', example='Normal'),
    sharedUnitNumLimit?: int32(name='SharedUnitNumLimit', description='The maximum number of units of the proxy service in shared mode.', example='3'),
    specType?: string(name='SpecType', description='The specification type.', example='dedicatedspec'),
    status?: string(name='Status', description='The status of the cluster. Valid values: 
 - PENDING_CREATE: The cluster is being created. 
 - ONLINE: The cluster is running. 
 - TENANT_CREATING: The tenant is being created. 
- TENANT_SPEC_MODIFYING: The tenant specifications are being modified. 
- EXPANDING: Nodes are being added to the cluster to increase its capacity. 
- REDUCING: Nodes are being removed from the cluster to reduce its capacity. 
- SPEC_UPGRADING: The service plan is being upgraded. 
- DISK_UPGRADING: The storage space is being expanded. 
- WHITE_LIST_MODIFYING: The whitelist is being modified. 
- PARAMETER_MODIFYING: Parameters are being modified. 
- SSL_MODIFYING: The SSL certificate is being changed. 
- PREPAID_EXPIRE_CLOSED: The payment is overdue. This parameter is valid for a cluster whose billing method is set to PREPAY. 
- ARREARS_CLOSED: The payment is overdue. This parameter is valid for a cluster whose billing method is set to POSTPAY. 
- PENDING_DELETE: The cluster is being deleted.    
Generally, the cluster is in the ONLINE state.', example='ONLINE'),
    tenantCreatable?: {
      disableCreateTenantReason?: string(name='DisableCreateTenantReason', description='The reason why you cannot create a tenant in the cluster.', example='CPU_NOT_ENOUGH,  MEMORY_NOT_ENOUGH, TENANT_COUNT_EXCEEDS_LIMIT'),
      enableCreateTenant?: boolean(name='EnableCreateTenant', description='Specifies whether a tenant can be created.', example='true'),
    }(name='TenantCreatable', description='Specifies whether a tenant can be created.'),
    unitSpec?: string(name='UnitSpec', description='The unit specification of the proxy service.', example='2C4G'),
    version?: string(name='Version', description='The version of OceanBase Database.', example='2.2.77'),
    zones?: [ string ](name='Zones', description='The ID of the zone to which the instance belongs.
<props="intl">For more information about how to obtain the list of zones, see [DescribeZones](https://www.alibabacloud.com/help/en/apsaradb-for-oceanbase/latest/api-oceanbasepro-2019-09-01-describezones).'),
  }(name='Instance', description='The information of the OceanBase cluster.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the detailed information of an OceanBase cluster.
 *
 * @param request DescribeInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceResponse
 */
async function describeInstanceWithOptions(request: DescribeInstanceRequest, runtime: Util.RuntimeOptions): DescribeInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstance',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the detailed information of an OceanBase cluster.
 *
 * @param request DescribeInstanceRequest
 * @return DescribeInstanceResponse
 */
async function describeInstance(request: DescribeInstanceRequest): DescribeInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceWithOptions(request, runtime);
}

model DescribeInstanceCreatableZoneRequest {
  instanceId?: string(name='InstanceId', description='The ID of the zone.

This parameter is required.', example='ob317v4uif****'),
}

model DescribeInstanceCreatableZoneResponseBody = {
  requestId?: string(name='RequestId', description='Indicates whether the cluster is deployed in the zone.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  zoneList?: [ 
    {
      fullCopyId?: string(name='FullCopyId'),
      isInCluster?: boolean(name='IsInCluster', example='true'),
      logicalZoneName?: string(name='LogicalZoneName'),
      replicateZoneIndex?: long(name='ReplicateZoneIndex'),
      zone?: string(name='Zone', description='DescribeInstanceCreatableZone', example='cn-hangzhou-i'),
    }
  ](name='ZoneList', description='The operation that you want to perform.   
Set the value to **DescribeInstanceCreatableZone**.'),
}

model DescribeInstanceCreatableZoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceCreatableZoneResponseBody(name='body'),
}

/**
 * @summary The ID of the zone.
 *
 * @param request DescribeInstanceCreatableZoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceCreatableZoneResponse
 */
async function describeInstanceCreatableZoneWithOptions(request: DescribeInstanceCreatableZoneRequest, runtime: Util.RuntimeOptions): DescribeInstanceCreatableZoneResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceCreatableZone',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The ID of the zone.
 *
 * @param request DescribeInstanceCreatableZoneRequest
 * @return DescribeInstanceCreatableZoneResponse
 */
async function describeInstanceCreatableZone(request: DescribeInstanceCreatableZoneRequest): DescribeInstanceCreatableZoneResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceCreatableZoneWithOptions(request, runtime);
}

model DescribeInstanceSSLRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId'),
}

model DescribeInstanceSSLResponseBody = {
  instanceSSL?: {
    autoUpdate?: string(name='AutoUpdate', description='The status of automatic update of SSL certificates. Valid values: 
* CLOSE: The automatic update of SSL certificates is disabled. 
* OPEN: The automatic update of SSL certificates is enabled.', example='OPEN'),
    caUrl?: string(name='CaUrl', description='The URL of the certificate authority (CA) node.', example='https://xxxx'),
    enableSSL?: string(name='EnableSSL', description='The operation to modify the SSL status. Valid values:

- open: Enable SSL encryption.

- update: Update the CA certificate.

- close: Disable SSL encryption.', example='OPEN'),
    forceSSL?: string(name='ForceSSL', description='The forced enabling status of SSL.', example='CLOSE'),
    forceSSLSupport?: boolean(name='ForceSSLSupport', description='Indicates whether SSL can be forcibly enabled.', example='false'),
    instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
    status?: string(name='Status', description='The SSL status of the cluster.', example='RUNNING'),
    tenantId?: string(name='TenantId'),
    validPeriod?: string(name='ValidPeriod', description='The validity period of the SSL certificate.', example='2024-09-20 07:55:03.0'),
  }(name='InstanceSSL', description='The SSL setting of the OceanBase cluster instance.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-xxxx-xxxx-87E3A8A2AA0C'),
}

model DescribeInstanceSSLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceSSLResponseBody(name='body'),
}

/**
 * @summary 查询集群SSL配置
 *
 * @param request DescribeInstanceSSLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceSSLResponse
 */
async function describeInstanceSSLWithOptions(request: DescribeInstanceSSLRequest, runtime: Util.RuntimeOptions): DescribeInstanceSSLResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceSSL',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询集群SSL配置
 *
 * @param request DescribeInstanceSSLRequest
 * @return DescribeInstanceSSLResponse
 */
async function describeInstanceSSL(request: DescribeInstanceSSLRequest): DescribeInstanceSSLResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceSSLWithOptions(request, runtime);
}

model DescribeInstanceSecurityConfigsRequest {
  checkId?: string(name='CheckId', description='The unique identifier of the check.', example='xxx'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
}

model DescribeInstanceSecurityConfigsResponseBody = {
  instanceSecurityConfigs?: {
    checkId?: string(name='CheckId', description='The unique identifier of the check.', example='xxx'),
    checkTime?: string(name='CheckTime', description='The time when the check was performed.', example='2023-08-07 15:30:00'),
    instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
    securityConfigs?: [ 
      {
        configDescription?: string(name='ConfigDescription', description='The name of the check item.', example='Check whether the scope of the cluster allowlist is too big'),
        configGroup?: string(name='ConfigGroup', description='The group of the check.', example='WHITELIST'),
        configName?: string(name='ConfigName', description='The name of the specific check item.', example='xxx'),
        risk?: boolean(name='Risk', description='Specifies whether a risk is detected.', example='true'),
        riskDescription?: string(name='RiskDescription', description='Security recommendations.', example='xxx'),
      }
    ](name='SecurityConfigs', description='The list of check items.'),
    totalCheckCount?: int32(name='TotalCheckCount', description='The total number of security check items for the cluster.', example='5'),
    totalRiskCount?: int32(name='TotalRiskCount', description='The total number of detected cluster security risks.', example='0'),
  }(name='InstanceSecurityConfigs', description='The return result of the request.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeInstanceSecurityConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceSecurityConfigsResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query security check items of an OceanBase cluster.
 *
 * @param request DescribeInstanceSecurityConfigsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceSecurityConfigsResponse
 */
async function describeInstanceSecurityConfigsWithOptions(request: DescribeInstanceSecurityConfigsRequest, runtime: Util.RuntimeOptions): DescribeInstanceSecurityConfigsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.checkId)) {
    body['CheckId'] = request.checkId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceSecurityConfigs',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query security check items of an OceanBase cluster.
 *
 * @param request DescribeInstanceSecurityConfigsRequest
 * @return DescribeInstanceSecurityConfigsResponse
 */
async function describeInstanceSecurityConfigs(request: DescribeInstanceSecurityConfigsRequest): DescribeInstanceSecurityConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceSecurityConfigsWithOptions(request, runtime);
}

model DescribeInstanceSummaryRequest {
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.    
- Start value: 1   
- Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of rows to return on each page.
- Maximum value: 100.
- Default value: 10.', example='10'),
}

model DescribeInstanceSummaryResponseBody = {
  instanceSummary?: {
    alarmSummaryCount?: long(name='AlarmSummaryCount', description='The total number of alerts during the query period.', example='1'),
    anomalySQLCount?: long(name='AnomalySQLCount', description='The total number of abnormal SQL statements.', example='1'),
    clusterInstancesCount?: long(name='ClusterInstancesCount', description='The number of cluster instances.', example='1'),
    expiredInstancesCount?: long(name='ExpiredInstancesCount', description='The number of expired instances.', example='1'),
    immediatelyExpiredInstancesCount?: long(name='ImmediatelyExpiredInstancesCount', description='The total number of expired instances to be released.', example='1'),
    insufficientDiskInstancesCount?: long(name='InsufficientDiskInstancesCount', description='The total number of clusters with capacity risks.', example='2'),
    overLoadInstancesCount?: long(name='OverLoadInstancesCount', description='The number of overloaded instances.', example='1'),
    regionalInstanceSummaryList?: [ 
      {
        expiredInstancesCount?: long(name='ExpiredInstancesCount', description='The number of expired instances.', example='1'),
        immediatelyExpiredInstancesCount?: long(name='ImmediatelyExpiredInstancesCount', description='The number of instances about to expire.', example='1'),
        recentCreatedInstancesCount?: long(name='RecentCreatedInstancesCount', description='The number of recently created instances.', example='1'),
        region?: string(name='Region', description='The ID of the region.', example='cn-shanghai'),
        runningInstancesCount?: long(name='RunningInstancesCount', description='The total number of running instances.', example='1'),
        totalInstancesCount?: long(name='TotalInstancesCount', description='The total number of instances.', example='3'),
      }
    ](name='RegionalInstanceSummaryList', description='A list of regional instances.'),
    runningInstancesCount?: long(name='RunningInstancesCount', description='The number of running instances.', example='1'),
    tenantInstancesCount?: long(name='TenantInstancesCount', description='The number of tenant instances.', example='1'),
    totalInstancesCount?: long(name='TotalInstancesCount', description='The total number of instances.', example='3'),
    totalOmsInstancesCount?: long(name='TotalOmsInstancesCount', description='The number of data transmission instances.', example='1'),
  }(name='InstanceSummary', description='The overview information about OceanBase instances.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeInstanceSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceSummaryResponseBody(name='body'),
}

/**
 * @summary Obtains the overview information about OceanBase instances.
 *
 * @param request DescribeInstanceSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceSummaryResponse
 */
async function describeInstanceSummaryWithOptions(request: DescribeInstanceSummaryRequest, runtime: Util.RuntimeOptions): DescribeInstanceSummaryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceSummary',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Obtains the overview information about OceanBase instances.
 *
 * @param request DescribeInstanceSummaryRequest
 * @return DescribeInstanceSummaryResponse
 */
async function describeInstanceSummary(request: DescribeInstanceSummaryRequest): DescribeInstanceSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceSummaryWithOptions(request, runtime);
}

model DescribeInstanceTagsRequest {
  instanceIds?: string(name='InstanceIds', description='The list of cluster IDs.', example='["ob3za5w73as8rk"]'),
  tags?: string(name='Tags', description='The tags.', example='[{"Key": "xxx", "Value", "xxx"},{}]'),
}

model DescribeInstanceTagsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tagResources?: [ 
    {
      resourceId?: string(name='ResourceId', description='The resource ID.', example='ob317v4uif****'),
      resourceType?: string(name='ResourceType', description='The type of the resource.', example='instance'),
      tag?: string(name='Tag', description='The tag of the resource.', example='[{"Key": "xxx", "Value", "xxx"},{}]'),
    }
  ](name='TagResources', description='The list of tags.'),
}

model DescribeInstanceTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceTagsResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the tags of clusters.
 *
 * @param request DescribeInstanceTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceTagsResponse
 */
async function describeInstanceTagsWithOptions(request: DescribeInstanceTagsRequest, runtime: Util.RuntimeOptions): DescribeInstanceTagsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceIds)) {
    body['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.tags)) {
    body['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceTags',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the tags of clusters.
 *
 * @param request DescribeInstanceTagsRequest
 * @return DescribeInstanceTagsResponse
 */
async function describeInstanceTags(request: DescribeInstanceTagsRequest): DescribeInstanceTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceTagsWithOptions(request, runtime);
}

model DescribeInstanceTenantModesRequest {
  instanceId?: string(name='InstanceId', description='The operation that you want to perform.   
Set the value to **DescribeInstanceTenantModes**.

This parameter is required.', example='ob317v4uif****'),
}

model DescribeInstanceTenantModesResponseBody = {
  instanceModes?: [ string ](name='InstanceModes'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeInstanceTenantModesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceTenantModesResponseBody(name='body'),
}

/**
 * @summary The return result of the request.
 *
 * @param request DescribeInstanceTenantModesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceTenantModesResponse
 */
async function describeInstanceTenantModesWithOptions(request: DescribeInstanceTenantModesRequest, runtime: Util.RuntimeOptions): DescribeInstanceTenantModesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceTenantModes',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The return result of the request.
 *
 * @param request DescribeInstanceTenantModesRequest
 * @return DescribeInstanceTenantModesResponse
 */
async function describeInstanceTenantModes(request: DescribeInstanceTenantModesRequest): DescribeInstanceTenantModesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceTenantModesWithOptions(request, runtime);
}

model DescribeInstanceTopologyRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
}

model DescribeInstanceTopologyResponseBody = {
  instanceTopology?: {
    replicas?: [ 
      {
        logicalZone?: string(name='LogicalZone', description='The ID of the replica.', example='cn-hangzhou-h-z0'),
        nodeNum?: int32(name='NodeNum', description='The number of nodes of the replica.', example='1'),
        readOnlyReplicaType?: string(name='ReadOnlyReplicaType', description='The type of the read-only replica.', example='ROW_STORE'),
        replicaResource?: {
          cpu?: {
            totalCpu?: int32(name='TotalCpu', description='The total number of CPU cores of the replica.', example='16'),
            usedCpu?: int32(name='UsedCpu', description='The number of CPU cores used by the replica.', example='8'),
          }(name='Cpu', description='The information about the CPU resources of the replica.'),
          diskSize?: {
            totalDiskSize?: long(name='TotalDiskSize', description='The total disk space of the replica, in GB.', example='100'),
            usedDiskSize?: float(name='UsedDiskSize', description='The disk space used by the replica, in GB.', example='50'),
          }(name='DiskSize', description='The information about the data disk of the replica.'),
          memory?: {
            totalMemory?: long(name='TotalMemory', description='The total memory size of the replica, in GB.', example='32'),
            usedMemory?: long(name='UsedMemory', description='The size of memory used by the replica, in GB.', example='16'),
          }(name='Memory', description='The information about the memory resources of the replica.'),
        }(name='ReplicaResource', description='The information about the replica resources.'),
        replicaType?: string(name='ReplicaType', description='The type of the replica.', example='FULL'),
        status?: string(name='Status', description='The status of the replica. Valid values: ACTIVE, INACTIVE, and UNKNOWN.', example='ACTIVE'),
        zoneLogicalId?: int32(name='ZoneLogicalId', description='The serial number of the replica.', example='1'),
        zoneLogicalName?: string(name='ZoneLogicalName', description='The region of the replica.', example='cn-hangzhou-h'),
        zoneRegionName?: string(name='ZoneRegionName', description='The zone of the replica.', example='cn-hangzhou-h'),
      }
    ](name='Replicas', description='The information about replicas.'),
    tenants?: [ 
      {
        primaryZoneDeployType?: string(name='PrimaryZoneDeployType', description='The deployment mode of the primary zone. Valid values: 
* RANDOM. 
* STATIC.', example='RANDOM'),
        tenantCpu?: float(name='TenantCpu', description='The number of CPU cores of the tenant.', example='2'),
        tenantDeployType?: string(name='TenantDeployType', description='The deployment type of the tenant. Valid values: 
* multiple: multi-IDC deployment. 
* single: single-IDC deployment. 
* dual: dual-IDC deployment.', example='multiple'),
        tenantDiskSize?: float(name='TenantDiskSize', description='The disk space of the tenant, in GB.', example='2'),
        tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t33h8y08k****'),
        tenantMemory?: float(name='TenantMemory', description='The memory size of the tenant, in GB.', example='10'),
        tenantMode?: string(name='TenantMode', description='The mode of the tenant. Valid values: 
* Oracle  
* MySQL', example='Oracle'),
        tenantName?: string(name='TenantName', description='The name of the tenant.', example='pay_online'),
        tenantStatus?: string(name='TenantStatus', description='The status of the tenant. Valid values: 
* PENDING_CREATE: The tenant is being created. 
* RESTORE: The tenant is being restored. 
* ONLINE: The tenant is running. 
* SPEC_MODIFYING: The specification of the tenant is being modified. 
* ALLOCATING_INTERNET_ADDRESS: A public IP address is being allocated to the tenant. 
* PENDING_OFFLINE_INTERNET_ADDRESS: The public IP address is being disabled. 
* PRIMARY_ZONE_MODIFYING: The tenant is being switched to a new primary zone. 
* PARAMETER_MODIFYING: Parameters are being modified. 
* WHITE_LIST_MODIFYING: The allowlist is being modified.', example='ONLINE'),
        tenantUnitCpu?: float(name='TenantUnitCpu', description='The number of CPU cores of a single node in the tenant.', example='4'),
        tenantUnitMemory?: float(name='TenantUnitMemory', description='The memory size of a single node in the tenant, in GB.', example='16'),
        tenantUnitNum?: int32(name='TenantUnitNum', description='The number of resource units in the tenant.', example='1'),
        tenantZones?: [ 
          {
            isPrimaryTenantZone?: boolean(name='IsPrimaryTenantZone', description='Indicates whether the zone is the primary zone.', example='true'),
            logicalZone?: string(name='LogicalZone', description='The ID of the replica.', example='cn-hangzhou-h-z0'),
            readOnlyReplicaType?: string(name='ReadOnlyReplicaType', description='The type of the read-only replica.', example='ROW_STORE'),
            replicaType?: string(name='ReplicaType', description='The replica type of the tenant.', example='FULL'),
            tenantZoneId?: string(name='TenantZoneId', description='The ID of the zone.', example='cn-hangzhou-h'),
            tenantZoneRole?: string(name='TenantZoneRole', description='The role to access the zone. Valid values: 
* ReadWrite: a role that has the read and write privileges. 
* ReadOnly: a role that has only the read-only privilege.', example='ReadWrite'),
            units?: [ 
              {
                enableCancelMigrateUnit?: boolean(name='EnableCancelMigrateUnit', description='Indicates whether the migration can be canceled. This parameter is valid only for resource units that are being manually immigrated or emigrated.', example='true'),
                enableMigrateUnit?: boolean(name='EnableMigrateUnit', description='Indicates whether the resource unit can be migrated.', example='true'),
                manualMigrate?: boolean(name='ManualMigrate', description='Indicates whether the resource unit is manually migrated.', example='true'),
                nodeId?: string(name='NodeId', description='The ID of the OBServer node in which the resource unit resides.', example='i-bp16niirq4zdmgvm****'),
                replicaType?: string(name='ReplicaType', description='The type of the replica. Node filtering conditions are configured based on the replica type when you query the monitoring data of the OceanBase cluster. 
* By default, the replica type is not specified when you query the monitoring data of OceanBase clusters or the access proxy. If you do not specify the replica type when you query the monitoring data of an OceanBase cluster, the monitoring data of all nodes is queried. 
* If you set the replica type to FULL when you query the monitoring data of an OceanBase cluster, the monitoring data of only the full-featured replica nodes is queried. 
* If you set the replica type to READONLY when you query the monitoring data of an OceanBase cluster, the monitoring data of only the read-only replica nodes is queried.', example='FULL'),
                unitCpu?: float(name='UnitCpu', description='The number of CPU cores of the resource unit.', example='2'),
                unitDataSize?: long(name='UnitDataSize', description='The data size of the resource unit.', example='10'),
                unitId?: string(name='UnitId', description='The ID of the resource unit.', example='1002'),
                unitMemory?: float(name='UnitMemory', description='The memory size of the resource unit, in GB.', example='10'),
                unitStatus?: string(name='UnitStatus', description='The status of the resource unit. Valid values: 
* ONLINE: The resource unit is running. 
* IMMIGRATING: The resource unit is being immigrated. 
* EMIGRATING: The resource unit is being emigrated. 
* CANCEL_EMIGRATING: The immigration of the resource unit is being canceled. 
* CANCEL_EMIGRATING: The emigration of the resource unit is being canceled. 
* DELETING: The resource unit is being deleted.', example='ONLINE'),
              }
            ](name='Units', description='The information about the resource units.'),
          }
        ](name='TenantZones', description='The information about the zones.'),
      }
    ](name='Tenants', description='The information about the tenants.'),
    zones?: [ 
      {
        nodes?: [ 
          {
            fullCopyId?: long(name='FullCopyId', description='The ID of the full-featured replica.', example='1'),
            logicalZone?: string(name='LogicalZone', description='The ID of the replica.', example='cn-hangzhou-h-z0'),
            nodeCopyId?: long(name='NodeCopyId', description='The ID of the replica node.', example='1'),
            nodeId?: string(name='NodeId', description='The ID of the node.', example='i-bp16niirq4zdmgvm****'),
            nodeResource?: {
              cpu?: {
                totalCpu?: int32(name='TotalCpu', description='The total number of CPU cores of the node.', example='14'),
                usedCpu?: float(name='UsedCpu', description='The number of CPU cores used by the node.', example='4'),
              }(name='Cpu', description='The information about the CPU resources of the node.'),
              diskSize?: {
                totalDiskSize?: double(name='TotalDiskSize', description='The total storage space of the node, in GB.', example='100'),
                usedDiskSize?: double(name='UsedDiskSize', description='The size of storage space used by the node, in GB.', example='50'),
              }(name='DiskSize', description='The information about the storage resources of the node.'),
              memory?: {
                totalMemory?: long(name='TotalMemory', description='The total memory size of the node, in GB.', example='70'),
                usedMemory?: float(name='UsedMemory', description='The size of memory used by the node, in GB.', example='10'),
              }(name='Memory', description='The information about the memory resources of the node.'),
            }(name='NodeResource', description='The information about node resources.'),
            nodeStatus?: string(name='NodeStatus', description='The status of the node.', example='ONLINE'),
            readOnlyCopyId?: long(name='ReadOnlyCopyId', description='The ID of the read-only replica.', example='1'),
            readOnlyReplicaType?: string(name='ReadOnlyReplicaType', description='The type of the read-only replica.', example='ROW_STORE'),
            replicaType?: string(name='ReplicaType', description='The type of the replica. Valid values: 
* FULL. 
* READONLY.', example='FULL'),
          }
        ](name='Nodes', description='The information about the nodes.'),
        region?: string(name='Region', description='The ID of the region.', example='cn-hangzhou'),
        zoneDisk?: string(name='ZoneDisk', description='The storage capacity of the zone.', example='200 GB'),
        zoneId?: string(name='ZoneId', description='The ID of the zone.', example='cn-hangzhou-i'),
        zoneResource?: {
          diskSize?: {
            maxDiskUsedObServer?: [ string ](name='MaxDiskUsedObServer', description='The IDs of OBServer nodes that use the maximum disk space.'),
            maxDiskUsedPercent?: double(name='MaxDiskUsedPercent', description='The maximum disk usage, in percentage.', example='0.14'),
          }(name='DiskSize', description='The information about the storage resources of the node.'),
        }(name='ZoneResource', description='The information about zones.'),
      }
    ](name='Zones', description='The information about the zones in which the cluster is deployed.'),
  }(name='InstanceTopology', description='The topology of the cluster.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeInstanceTopologyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceTopologyResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the topology of an OceanBase cluster.
 *
 * @param request DescribeInstanceTopologyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceTopologyResponse
 */
async function describeInstanceTopologyWithOptions(request: DescribeInstanceTopologyRequest, runtime: Util.RuntimeOptions): DescribeInstanceTopologyResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceTopology',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the topology of an OceanBase cluster.
 *
 * @param request DescribeInstanceTopologyRequest
 * @return DescribeInstanceTopologyResponse
 */
async function describeInstanceTopology(request: DescribeInstanceTopologyRequest): DescribeInstanceTopologyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceTopologyWithOptions(request, runtime);
}

model DescribeInstancesRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
  instanceName?: string(name='InstanceName', description='The name of the OceanBase cluster. It must be 1 to 20 characters in length. If this parameter is not specified, the value is the instance ID of the cluster by default.', example='ob4prod'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.
- Pages start from page 1.
- Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of rows to return on each page.
- Maximum value: 100.
- Default value: 10.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. If you do not specify this parameter, all resources are returned.', example='group1'),
  searchKey?: string(name='SearchKey', description='The keyword for fuzzy search, which can be an instance ID, instance name, tenant ID, or tenant name.', example='pay'),
}

model DescribeInstancesResponseBody = {
  instances?: [ 
    {
      availableZones?: [ string ](name='AvailableZones', description='The information about the zone in which the cluster is deployed.'),
      commodityCode?: string(name='CommodityCode', description='The product code of the OceanBase cluster.   
- oceanbase_oceanbasepre_public_cn: indicates an OceanBase cluster that is billed based on the subscription plan and that is deployed in a China site.  
- oceanbase_oceanbasepost_public_cn: indicates an OceanBase cluster that is billed based on the pay-as-you-go plan and that is deployed in a China site.  
- oceanbase_obpre_public_intl: indicates an OceanBase cluster that is billed based on the subscription plan and that is deployed in an international site.', example='oceanbase_oceanbasepost_public_cn'),
      cpu?: int32(name='Cpu', description='The number of CPU cores of the cluster.', example='14'),
      cpuArchitecture?: string(name='CpuArchitecture', description='The CPU architecture of the cluster.', example='X86_64, AARCH64'),
      createTime?: string(name='CreateTime', description='The time in UTC when the cluster was created.', example='2021-10-19T07:13:41Z'),
      dataDiskAutoScaleConfig?: {
        autoScale?: boolean(name='AutoScale', description='Specifies whether to enable the automatic scaling of the data disk.', example='true'),
        maxDiskSize?: long(name='MaxDiskSize', description='The maximum size of the disk, in GB.', example='80000'),
        scaleStepInMerge?: double(name='ScaleStepInMerge', description='The size of scaling step during a major compaction.', example='100'),
        scaleStepInNormal?: double(name='ScaleStepInNormal', description='The size of scaling step during daily use.', example='50'),
        upperMergeThreshold?: double(name='UpperMergeThreshold', description='The maximum usage of the data disk, in percentage, that triggers the scaling of the data disk for major compactions.', example='90'),
        upperScaleStrategy?: string(name='UpperScaleStrategy', description='The scale-out strategy. Valid values: RAW and PERCENTAGE.', example='RAW'),
        upperThreshold?: double(name='UpperThreshold', description='The maximum usage of the data disk, in percentage, that triggers the scaling of the data disk for daily use.', example='80'),
        upperbound?: double(name='Upperbound', description='The maximum space, in GB, to which the data disk can be scaled.', example='16'),
      }(name='DataDiskAutoScaleConfig', description='Specifies parameters for the automatic scaling of the data disk.'),
      deployMode?: string(name='DeployMode', description='The data replica distribution mode of the cluster. The value is in the n-n-n format, where n is the number of OBServer nodes in each IDC.', example='1-1-1'),
      deployType?: string(name='DeployType', description='The deployment type of the cluster. Valid values:   
- multiple: multi-IDC deployment  
- single: single-IDC deployment  
- dual: dual-IDC deployment', example='multiple'),
      diskSize?: long(name='DiskSize', description='The size of the storage space, in GB.', example='200'),
      diskType?: string(name='DiskType', description='The type of the storage disk where the cluster is deployed.   
The default value is cloud_essd_pl1, which indicates an ESSD cloud disk.', example='cloud_essd_pl1'),
      enableReadOnlyReplicaManagement?: boolean(name='EnableReadOnlyReplicaManagement', description='Indicates whether the cluster supports read-only replicas.', example='yes'),
      enableUpgradeNodes?: boolean(name='EnableUpgradeNodes', description='Indicates whether new nodes can be added.', example='true'),
      expireSeconds?: int32(name='ExpireSeconds', description='The time elapsed since the expiration of the cluster, in seconds. 
> In subscription mode, if the cluster has not expired, this parameter indicates the remaining validity period of the cluster. If the cluster has expired, this parameter indicates the time elapsed since the expiration.', example='2606682'),
      expireTime?: string(name='ExpireTime', description='The time in UTC when the cluster expires. 
> This parameter is valid only for subscription instances.', example='2021-10-17T16:00:00Z'),
      inTempCapacityStatus?: boolean(name='InTempCapacityStatus', description='Specifies whether to indicate the temporary status of the capacity.', example='false'),
      instanceClass?: string(name='InstanceClass', description='The specifications of the cluster.  You can specify one of the following four plans:  
- 8C32G: indicates 8 CPU cores and 32 GB of memory.  
- 14C70G: indicates 14 CPU cores and 70 GB of memory.  
- 30C180G: indicates 30 CPU cores and 180 GB of memory.  
- 62C400G: indicates 62 CPU cores and 400 GB of memory.', example='14C70G'),
      instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
      instanceName?: string(name='InstanceName', description='The name of the OceanBase cluster.', example='ob4test'),
      instanceRole?: string(name='InstanceRole', description='The role of the instance.', example='NORMAL'),
      instanceType?: string(name='InstanceType', description='The instance type.
- cluster: indicates a cluster instance.
- mtenant: indicates a tenant instance in MySQL mode.
- mtenant_serverless: indicates a serverless instance in MySQL mode.', example='CLUSTER'),
      maintainTime?: string(name='MaintainTime', description='The time period in UTC for the daily routine maintenance of the cluster.', example='2021-10-19T07:13:41Z'),
      mem?: long(name='Mem', description='The memory size of the instance, in GB.', example='70'),
      obRpmVersion?: string(name='ObRpmVersion', description='The version of the OceanBase Database RedHat Package Managerment (RPM) package.', example='4.2.1.7-107030032024062709'),
      payType?: string(name='PayType', description='The billing method for the OceanBase cluster. Valid values:  
- PREPAY: the subscription billing method.  
- POSTPAY: the pay-as-you-go billing method.', example='PREPAY'),
      replicaMode?: string(name='ReplicaMode', example='3F、2F1A'),
      resource?: {
        capacityUnit?: {
          maxCapacityUnit?: int32(name='MaxCapacityUnit', description='The maximum number of capacity units.', example='4'),
          minCapacityUnit?: int32(name='MinCapacityUnit', description='The minimum number of capacity units.', example='1'),
          usedCapacityUnit?: int32(name='UsedCapacityUnit', description='The number of used capacity units.', example='2'),
        }(name='CapacityUnit', description='The information about capacity units.'),
        cpu?: {
          originalTotalCpu?: double(name='OriginalTotalCpu', description='The number of original CPU cores in the cluster.', example='14'),
          totalCpu?: double(name='TotalCpu', description='The total number of CPU cores of the cluster.', example='14'),
          unitCpu?: double(name='UnitCpu', description='The number of CPU cores of each replica node in the cluster.', example='10'),
          usedCpu?: double(name='UsedCpu', description='The number of CPU cores used in the cluster.', example='10'),
        }(name='Cpu', description='The information about the CPU resources of the cluster.'),
        diskSize?: {
          originalTotalDiskSize?: double(name='OriginalTotalDiskSize', description='The original size of the disk.', example='200'),
          totalDiskSize?: double(name='TotalDiskSize', description='The total storage space of the cluster, in GB.', example='200'),
          unitDiskSize?: double(name='UnitDiskSize', description='The storage space of each replica node in the cluster, in GB.', example='200'),
          usedDiskSize?: long(name='UsedDiskSize', description='The size of used storage space of the cluster, in GB.', example='100'),
        }(name='DiskSize', description='The information about the storage resources of the cluster.'),
        memory?: {
          originalTotalMemory?: double(name='OriginalTotalMemory', description='The original memory size of the cluster, in GB.', example='72'),
          totalMemory?: double(name='TotalMemory', description='The total memory size of the cluster, in GB.', example='70'),
          unitMemory?: long(name='UnitMemory', description='The memory size of each replica node in the cluster, in GB.', example='10'),
          usedMemory?: long(name='UsedMemory', description='The size of used memory in the cluster, in GB.', example='10'),
        }(name='Memory', description='The information about the memory resources of the cluster.'),
        unitCount?: long(name='UnitCount', description='The number of resource units in the cluster.', example='1'),
      }(name='Resource', description='The information about cluster resources.'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='group1'),
      series?: string(name='Series', description='The series of the OceanBase cluster. Valid values:   
- NORMAL: the high availability edition.   
- BASIC: the basic edition.', example='NORMAL'),
      specType?: string(name='SpecType', description='The specification type.', example='dedicatedspec'),
      state?: string(name='State', description='The status of the cluster. Valid values:   
- ONLINE: The cluster is running.  
- PENDING_CREATE: The cluster is being created.  
- ARREARS_CLOSED("arrears_closed"): The cluster is suspended due to insufficient balance.
- PREPAID_EXPIRE_CLOSED("prepaid_expire_closed"): The cluster is suspended because the subscription has expired.
- WHITE_LIST_MODIFYING("white_list_modifying"): The allowlist of the cluster is being modified.
- SSL_MODIFYING("ssl_modifying"): The Secure Sockets Layer (SSL) settings of the cluster are being modified.
- PARAMETER_MODIFYING("parameter_modifying"): Parameters of the cluster are being modified.
- TENANT_CREATING("tenant_creating"): A tenant is being created in the cluster.
- TENANT_SPEC_MODIFYING("tenant_spec_modifying"): The specifications of a tenant in the cluster are being modified.
- EXPANDING("expanding"): Nodes are being added to the cluster.
- REDUCING("reducing"): Nodes are being removed from the cluster.
- ZONE_CHANGING("zone_changing"): Zones of the cluster are being modified.
- SPEC_UPGRADING: The service plan is being upgraded.
- SPEC_DOWNGRADING("spec_downgrading"): The plan specification is being downgraded.
- DISK_UPGRADING: The storage space is being expanded.
- UPGRADING("upgrading"): The version of the cluster is being upgraded.
- PENDING_DELETE("pending_delete"): The cluster is being deleted.
- DELETED("deleted"): The cluster has been deleted.
- ABNORMAL("abnormal"): The cluster is abnormal.
- OFFLINE("offline"): The cluster is offline.
- STANDBY_CREATING("standby_creating"): A standby cluster is being created for the cluster.
- STANDBY_DELETING("standby_deleting"): A standby cluster of the cluster is being deleted.
- SWITCHOVER_SWITCHING("switchover_switching"): The cluster is undergoing a primary/standby switchover.
- STANDBY_DISCONNECTING("standby_disconnecting"): The cluster is being decoupled from its standby cluster.
- LOG_DISK_UPGRADING("log_disk_upgrading"): The log disk of the cluster is being scaled out.
- ISOLATION_OPTIMIZATION_MODIFYING("isolation_optimization_modifying"): The isolation optimization settings of the cluster are being modified.
- DISKTYPE_MODIFYING("disktype_modifying"): The data disk type of the cluster is being modified.
- PROXY_SERVICE_CREATING("proxy_service_creating"): The proxy service is being enabled for the cluster.
- PROXY_SERVICE_DELETING("proxy_service_deleting"): The proxy service is being disabled for the cluster.
- PROXY_SERVICE_SPEC_MODIFYING("proxy_service_spec_modifying"): The proxy service specification is being modified for the cluster.
- READONLY_ADD_NODE("readonly_add_node"): A read-only node is being added to the cluster.
- READONLY_REDUCE_NODE("readonly_reduce_node"): A read-only node is being removed from the cluster.
- READONLY_REDUCE_ZONE("readonly_reduce_zone"): A read-only zone is being removed from the cluster.
- READONLY_ADD_ZONE("readonly_add_zone"): A read-only zone is being added to the cluster.
- READONLY_UPGRADE_SPEC("readonly_upgrade_spec"): The specification of read-only replicas is being upgraded.
- READONLY_UPGRADE_DISK("readonly_upgrade_disk"): The disk space of read-only replicas is being scaled out.
- READONLY_DOWNGRADE_SPEC("readonly_downgrade_spec"): The specification of read-only replicas is being downgraded.
- READONLY_DOWNGRADE_DISK("readonly_downgrade_disk"): The disk space of read-only replicas is being scaled in.
- CREATING_TENANT_READONLY_REPLICA("creating_tenant_readonly_replica"): A read-only replica is being created for a tenant in the cluster.
- DELETING_TENANT_READONLY_REPLICA("deleting_tenant_readonly_replica"): A read-only replica is being deleted for a tenant in the cluster.
- DISK_DOWNGRADING("disk_downgrading"): The disk space of the cluster is being scaled in.
- DEPLOY_MODE_MODIFYING("deploy_mode_modifying"): The deployment mode of the cluster is being modified.
> Generally, the cluster is in the ONLINE state.', example='ONLINE'),
      usedDiskSize?: long(name='UsedDiskSize', description='The size of used storage space of the cluster, in GB.', example='20'),
      version?: string(name='Version', description='The OBServer version.', example='2.2.77'),
      vpcId?: string(name='VpcId', description='vpcId', example='vpc-8vb8qjrixzovjpy******'),
    }
  ](name='Instances', description='The information of the OceanBase cluster.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  totalCount?: int32(name='TotalCount', description='The number of OceanBase clusters queried.', example='2'),
}

model DescribeInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstancesResponseBody(name='body'),
}

/**
 * @summary You can call this operation to obtain the list of OceanBase clusters.
 *
 * @param request DescribeInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstancesResponse
 */
async function describeInstancesWithOptions(request: DescribeInstancesRequest, runtime: Util.RuntimeOptions): DescribeInstancesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceName)) {
    body['InstanceName'] = request.instanceName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.searchKey)) {
    body['SearchKey'] = request.searchKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstances',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to obtain the list of OceanBase clusters.
 *
 * @param request DescribeInstancesRequest
 * @return DescribeInstancesResponse
 */
async function describeInstances(request: DescribeInstancesRequest): DescribeInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstancesWithOptions(request, runtime);
}

model DescribeMetricsDataRequest {
  endTime?: string(name='EndTime', description='This parameter is required.', example='2021-06-13T15:40:43Z'),
  groupByLabels?: string(name='GroupByLabels', description='This parameter is required.', example='app,clusterId'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob317v4uif****'),
  labels?: string(name='Labels', description='This parameter is required.', example='app:OB,clusterId:ob***'),
  limit?: string(name='Limit', example='5'),
  metrics?: string(name='Metrics', description='This parameter is required.', example='tps'),
  replicaType?: string(name='ReplicaType'),
  sortMetricKey?: string(name='SortMetricKey', example='tps'),
  sortOrder?: string(name='SortOrder', example='DESC'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2021-06-13T15:40:43Z'),
}

model DescribeMetricsDataResponseBody = {
  data?: [ string ](name='Data', example='[
                {
                    "sql_select_count":75.****15****1515,
                    "timestamp":165079****
                },
                ......
            ]'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeMetricsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricsDataResponseBody(name='body'),
}

/**
 * @summary 查询监控指标数据
 *
 * @param request DescribeMetricsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricsDataResponse
 */
async function describeMetricsDataWithOptions(request: DescribeMetricsDataRequest, runtime: Util.RuntimeOptions): DescribeMetricsDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.groupByLabels)) {
    query['GroupByLabels'] = request.groupByLabels;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.labels)) {
    query['Labels'] = request.labels;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.metrics)) {
    query['Metrics'] = request.metrics;
  }
  if (!Util.isUnset(request.sortMetricKey)) {
    query['SortMetricKey'] = request.sortMetricKey;
  }
  if (!Util.isUnset(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.replicaType)) {
    body['ReplicaType'] = request.replicaType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricsData',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询监控指标数据
 *
 * @param request DescribeMetricsDataRequest
 * @return DescribeMetricsDataResponse
 */
async function describeMetricsData(request: DescribeMetricsDataRequest): DescribeMetricsDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricsDataWithOptions(request, runtime);
}

model DescribeNodeMetricsRequest {
  endTime?: string(name='EndTime', description='$.parameters[7].schema.description

This parameter is required.', example='2021-09-13T15:40:43Z'),
  instanceId?: string(name='InstanceId', description='The list of nodes.

This parameter is required.', example='ob317v4uif****'),
  metrics?: string(name='Metrics', description='$.parameters[7].schema.enumValueTitles

This parameter is required.', example='tps'),
  nodeIdList?: string(name='NodeIdList', description='$.parameters[10].schema.description', example='[i-bp16niirq4zdmgvm****,i-bp16n56hq4z4fgvm****]'),
  nodeName?: string(name='NodeName', description='$.parameters[8].schema.example', example='i-bp16niirq4zdmgvm****'),
  pageNumber?: int32(name='PageNumber', description='$.parameters[6].schema.description', example='1'),
  pageSize?: int32(name='PageSize', description='The ID of the tenant.', example='10'),
  startTime?: string(name='StartTime', description='$.parameters[9].schema.example

This parameter is required.', example='2021-06-13T15:40:43Z'),
  tenantId?: string(name='TenantId', description='$.parameters[6].schema.enumValueTitles', example='tfafd34fs****'),
}

model DescribeNodeMetricsResponseBody = {
  nodeMetrics?: string(name='NodeMetrics', example='-'),
  requestId?: string(name='RequestId', description='You can call this operation to query the detailed metrics information of an OceanBase Database node.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  totalCount?: int32(name='TotalCount', description='```
http(s)://[Endpoint]/?Action=DescribeNodeMetrics
&InstanceId=ob317v4uif****
&PageSize=10
&PageNumber=1
&TenantId=ob2mr3oae0****
&StartTime=2021-06-13 15:40:43
&EndTime=2021-09-13 15:40:43
&Metrics=tps
&NodeName=i-bp16niirq4zdmgvm****
&NodeIdList=["i-bp19y05uq6xpacyqnlrc","i-bp1blcr3htr3g3u2vqvu","i-bp1392ikhayhr3hi4fli"]
&Common request parameters
```', example='9'),
}

model DescribeNodeMetricsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeNodeMetricsResponseBody(name='body'),
}

/**
 * @summary The list of nodes.
 *
 * @param request DescribeNodeMetricsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeNodeMetricsResponse
 */
async function describeNodeMetricsWithOptions(request: DescribeNodeMetricsRequest, runtime: Util.RuntimeOptions): DescribeNodeMetricsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.metrics)) {
    body['Metrics'] = request.metrics;
  }
  if (!Util.isUnset(request.nodeIdList)) {
    body['NodeIdList'] = request.nodeIdList;
  }
  if (!Util.isUnset(request.nodeName)) {
    body['NodeName'] = request.nodeName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeNodeMetrics',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The list of nodes.
 *
 * @param request DescribeNodeMetricsRequest
 * @return DescribeNodeMetricsResponse
 */
async function describeNodeMetrics(request: DescribeNodeMetricsRequest): DescribeNodeMetricsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeNodeMetricsWithOptions(request, runtime);
}

model DescribeOasAnomalySQLListRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The language of the response. Valid values:
- zh: Chinese
- en: English', example='zh-CN'),
  current?: long(name='Current', description='The current page.', example='1'),
  dbName?: string(name='DbName', description='The name of the database.', example='db_****'),
  dynamicSql?: boolean(name='DynamicSql', description='Specifies whether the specified SQL statements are dynamic SQL statements.
> This parameter specifies whether the values of the `SqlId` parameter are the IDs of dynamic SQL statements.', example='false'),
  endTime?: string(name='EndTime', description='The end time of the monitoring data.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T05:38:38Z'),
  filterCondition?: string(name='FilterCondition', description='All parameters are referenced by the symbol @. For a list of available parameters, refer to the returned parameters in [Query performance indicators of an SQL statement](https://en.oceanbase.com/docs/community-ocp-en-10000000000840290).', example='@avgCpuTime > 20 and @executions > 100'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  mergeDynamicSql?: boolean(name='MergeDynamicSql', description='Specifies whether to merge dynamic SQL statements in the return result. 

> This parameter specifies whether to aggregate the results of IN queries.', example='false'),
  nodeIp?: string(name='NodeIp', description='The node IP.', example='i-bp19y05uq6x*********'),
  pageSize?: long(name='PageSize', description='Page size.
- Start value: 1
- Default value: 1', example='10'),
  searchKeyWord?: string(name='SearchKeyWord', description='The search keyword.', example='update'),
  searchParam?: string(name='SearchParam', description='The search parameter.', example='cputime'),
  searchRule?: string(name='SearchRule', description='The search rule.   
Valid values: "=", ">", ">=", "<", and "<="', example='>'),
  searchValue?: string(name='SearchValue', description='The search value.', example='0.01'),
  sqlId?: string(name='SqlId', description='SQL ID.', example='8D6E84****0B8FB1823D199E2CA1****'),
  sqlTextLength?: long(name='SqlTextLength', description='Max length of the returned SQL text.', example='65535'),
  startTime?: string(name='StartTime', description='The start time of the monitoring data.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T04:38:38Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model DescribeOasAnomalySQLListResponseBody = {
  data?: [ 
    {
      avgCpuTime?: double(name='AvgCpuTime', description='Average CPU time of the suspicious SQL.', example='100.24'),
      avgDbTime?: double(name='AvgDbTime', description='The average DB time.', example='100'),
      avgElapsedTime?: double(name='AvgElapsedTime', description='Average response time of the suspicious SQL.', example='100.28'),
      avgGetPlanTime?: double(name='AvgGetPlanTime', description='Average time to obtain the execution plan of the suspicious SQL.', example='0'),
      avgLogicalReads?: float(name='AvgLogicalReads', description='The average number of logical reads.', example='25'),
      avgRetryCount?: float(name='AvgRetryCount', description='The average number of retries.', example='4'),
      cpuTime?: double(name='CpuTime', description='CPU time of the suspicious SQL.', example='100.23'),
      dbName?: string(name='DbName', description='The name of the database.', example='db_***'),
      diagTypes?: [ string ](name='DiagTypes', description='The type of the diagnosis.'),
      diagnosis?: string(name='Diagnosis', description='The details of diagnosis.', example='-'),
      dynamicSql?: boolean(name='DynamicSql', description='是否动态SQL', example='false'),
      executions?: double(name='Executions', description='Total execution count of the suspicious SQL.', example='1'),
      lastExecutedTime?: double(name='LastExecutedTime', description='Last execution time of the suspicious SQL.', example='2023-04-12T04:38:38Z'),
      riskLevel?: string(name='RiskLevel', description='Risk level.', example='high'),
      sqlId?: string(name='SqlId', description='SQL ID.', example='8D6E84****0B8FB1823D199E2CA1****'),
      sqlList?: [ 
        {
          avgCpuTime?: double(name='AvgCpuTime', description='The average CPU time.', example='100.24'),
          avgDbTime?: double(name='AvgDbTime', description='The average DB time.', example='100'),
          avgElapsedTime?: double(name='AvgElapsedTime', description='The average response time.', example='100.28'),
          avgGetPlanTime?: double(name='AvgGetPlanTime', description='The average plan generation time.', example='0'),
          avgLogicalReads?: float(name='AvgLogicalReads', description='The average number of logical reads.', example='25'),
          avgRetryCount?: float(name='AvgRetryCount', description='The average number of retries.', example='4'),
          cpuTime?: double(name='CpuTime', description='The total CPU time.', example='100.23'),
          dbName?: string(name='DbName', description='The name of the database.', example='test_hsp****eway'),
          diagTypes?: [ string ](name='DiagTypes', description='The diagnostic types.'),
          diagnosis?: string(name='Diagnosis', description='The diagnostic details. 

> This parameter is deprecated.', example='-'),
          executions?: double(name='Executions', description='The total number of executions.', example='100'),
          lastExecutedTime?: string(name='LastExecutedTime', description='The last execution time.', example='2023-04-12T04:38:38Z'),
          riskLevel?: string(name='RiskLevel', description='The risk level.', example='LOW'),
          sqlId?: string(name='SqlId', description='The ID of the SQL statement.', example='3A645****789F13DE0CF6D084FF9****'),
          sqlTextShort?: string(name='SqlTextShort', description='The prefix of the SQL text.', example='select * from test'),
          suggestion?: string(name='Suggestion', description='The suggestion on the suspicious SQL statement.', example='{\\\\"Role\\\\": \\\\"eSG\\\\", \\\\"Result\\\\": \\\\"100\\\\", \\\\"Suggestion\\\\": \\\\"TRACER_OTHER_ERR\\\\"}'),
          sumDbTime?: double(name='SumDbTime', description='The total DB time.', example='100'),
          sumElapsedTime?: string(name='SumElapsedTime', description='The total response time.', example='11452126.36'),
          sumRetryCount?: float(name='SumRetryCount', description='The total number of retries.', example='6'),
          userName?: string(name='UserName', description='The username.', example='test_user'),
        }
      ](name='SqlList', description='The list of SQL statements.'),
      sqlTextShort?: string(name='SqlTextShort', description='Prefix of the SQL text.'),
      suggestion?: string(name='Suggestion', description='Suggestion for the suspicious SQL.', example='review'),
      sumDbTime?: double(name='SumDbTime', description='The total DB time.', example='100'),
      sumElapsedTime?: string(name='SumElapsedTime', description='Total response time of the suspicious SQL.', example='11452126.36'),
      sumRetryCount?: float(name='SumRetryCount', description='The total number of retries.', example='6'),
      userName?: string(name='UserName', description='Username.', example='test_user'),
    }
  ](name='Data', description='The information about suspicious SQL statements.'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469**-AA6F-4D**-B3DB-A***********'),
  totalCount?: long(name='TotalCount', description='The total count.', example='9'),
}

model DescribeOasAnomalySQLListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOasAnomalySQLListResponseBody(name='body'),
}

/**
 * @summary You can call this API to view the list of SQL statements that are identified as having performance issues by the diagnostic system.
 *
 * @param request DescribeOasAnomalySQLListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOasAnomalySQLListResponse
 */
async function describeOasAnomalySQLListWithOptions(request: DescribeOasAnomalySQLListRequest, runtime: Util.RuntimeOptions): DescribeOasAnomalySQLListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    body['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.current)) {
    body['Current'] = request.current;
  }
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.dynamicSql)) {
    body['DynamicSql'] = request.dynamicSql;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.filterCondition)) {
    body['FilterCondition'] = request.filterCondition;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.mergeDynamicSql)) {
    body['MergeDynamicSql'] = request.mergeDynamicSql;
  }
  if (!Util.isUnset(request.nodeIp)) {
    body['NodeIp'] = request.nodeIp;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.searchKeyWord)) {
    body['SearchKeyWord'] = request.searchKeyWord;
  }
  if (!Util.isUnset(request.searchParam)) {
    body['SearchParam'] = request.searchParam;
  }
  if (!Util.isUnset(request.searchRule)) {
    body['SearchRule'] = request.searchRule;
  }
  if (!Util.isUnset(request.searchValue)) {
    body['SearchValue'] = request.searchValue;
  }
  if (!Util.isUnset(request.sqlId)) {
    body['SqlId'] = request.sqlId;
  }
  if (!Util.isUnset(request.sqlTextLength)) {
    body['SqlTextLength'] = request.sqlTextLength;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOasAnomalySQLList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this API to view the list of SQL statements that are identified as having performance issues by the diagnostic system.
 *
 * @param request DescribeOasAnomalySQLListRequest
 * @return DescribeOasAnomalySQLListResponse
 */
async function describeOasAnomalySQLList(request: DescribeOasAnomalySQLListRequest): DescribeOasAnomalySQLListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOasAnomalySQLListWithOptions(request, runtime);
}

model DescribeOasSQLDetailsRequest {
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test_db'),
  dynamicSql?: boolean(name='DynamicSql'),
  endTime?: string(name='EndTime', description='The end time of querying the SQL execution plan.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T05:38:38Z'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  parseTable?: boolean(name='ParseTable'),
  sqlId?: string(name='SqlId', description='SQL ID.

This parameter is required.', example='8D6E84****0B8FB1823D199E2CA1****'),
  startTime?: string(name='StartTime', description='The start time of querying the SQL execution plan.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T04:38:38Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model DescribeOasSQLDetailsResponseBody = {
  data?: {
    dbName?: string(name='DbName', description='The name of the database.', example='test_db'),
    fulltext?: string(name='Fulltext', description='SQL text.', example='select a from b'),
    statement?: string(name='Statement', description='Parameterized text.', example='select a from b'),
    tables?: [ string ](name='Tables', description='The table name related to the SQL.'),
    userName?: string(name='UserName', description='The username.', example='test_user'),
  }(name='Data', description='The list of the SQL execution plan.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeOasSQLDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOasSQLDetailsResponseBody(name='body'),
}

/**
 * @summary You can call this API to query detailed information about the SQL, including the SQL text, related table names, and so on.
 *
 * @param request DescribeOasSQLDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOasSQLDetailsResponse
 */
async function describeOasSQLDetailsWithOptions(request: DescribeOasSQLDetailsRequest, runtime: Util.RuntimeOptions): DescribeOasSQLDetailsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.dynamicSql)) {
    body['DynamicSql'] = request.dynamicSql;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.parseTable)) {
    body['ParseTable'] = request.parseTable;
  }
  if (!Util.isUnset(request.sqlId)) {
    body['SqlId'] = request.sqlId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOasSQLDetails',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this API to query detailed information about the SQL, including the SQL text, related table names, and so on.
 *
 * @param request DescribeOasSQLDetailsRequest
 * @return DescribeOasSQLDetailsResponse
 */
async function describeOasSQLDetails(request: DescribeOasSQLDetailsRequest): DescribeOasSQLDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOasSQLDetailsWithOptions(request, runtime);
}

model DescribeOasSQLHistoryListRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The language of the response. Valid values:
- zh: Chinese
- en: English', example='zh-CN'),
  dbName?: string(name='DbName', description='The name of the database.', example='test_db'),
  dynamicSql?: boolean(name='DynamicSql', description='Specifies whether the SQL statement is a dynamic SQL statement.', example='false'),
  endTime?: string(name='EndTime', description='The end time of querying the execution history of the SQL statement.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T05:38:38Z'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  nodeIp?: string(name='NodeIp', description='The IP address of the node.', example='i-bp19y05uq6x*********'),
  sqlId?: string(name='SqlId', description='SQL ID.

This parameter is required.', example='8D6E84****0B8FB1823D199E2CA1****'),
  startTime?: string(name='StartTime', description='The start time of querying the execution history of the SQL statement.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T04:38:38Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model DescribeOasSQLHistoryListResponseBody = {
  data?: [ 
    {
      avgAffectedRows?: long(name='AvgAffectedRows', description='Average updated rows during the execution period.', example='9978.75'),
      avgApplicationWaitTime?: double(name='AvgApplicationWaitTime', description='Average Application event wait time (in milliseconds) during the client waiting period.', example='0.0'),
      avgBlockCacheHit?: long(name='AvgBlockCacheHit', description='Average BlockCache hit count during the execution period.', example='0.0'),
      avgBlockIndexCacheHit?: long(name='AvgBlockIndexCacheHit', description='Average BlockIndexCache hit count during the execution period.', example='0.0'),
      avgBloomFilterCacheHit?: long(name='AvgBloomFilterCacheHit', description='Average BloomFilterCache hit count during the execution period.', example='0.0'),
      avgConcurrencyWaitTime?: double(name='AvgConcurrencyWaitTime', description='Average Concurrency event wait time (in milliseconds) during the execution period.', example='0.0'),
      avgCpuTime?: double(name='AvgCpuTime', description='Average CPU time (in milliseconds) during the execution period.', example='1875.34'),
      avgDbTime?: double(name='AvgDbTime', description='The average DB time, in milliseconds.', example='100'),
      avgDecodeTime?: double(name='AvgDecodeTime', description='Average syntax parsing time (in milliseconds) during the execution period.', example='0.0'),
      avgDiskReads?: long(name='AvgDiskReads', description='Average physical read count during the execution period.', example='0.0'),
      avgElapsedTime?: double(name='AvgElapsedTime', description='Average response time (in milliseconds) during the execution period.', example='1876.78'),
      avgExecuteTime?: double(name='AvgExecuteTime', description='Average plan execution time (in milliseconds) during the execution period.', example='1895.7'),
      avgExecutorRpcCount?: double(name='AvgExecutorRpcCount', description='Average number of RPC requests executed during the execution period.', example='0'),
      avgExpectedWorkerCount?: double(name='AvgExpectedWorkerCount', description='Average degree of parallelism during the execution period.', example='3'),
      avgGetPlanTime?: double(name='AvgGetPlanTime', description='Average plan generation time (in milliseconds) during the execution period.', example='0.0'),
      avgLogicalReads?: long(name='AvgLogicalReads', description='Average logical reads during the execution period.', example='0.0'),
      avgMemstoreReadRows?: long(name='AvgMemstoreReadRows', description='Average Memstore read rows during the execution period.', example='0.0'),
      avgNetTime?: double(name='AvgNetTime', description='Average network transmission time (in milliseconds) during the execution period.', example='8'),
      avgNetWaitTime?: double(name='AvgNetWaitTime', description='Average network enqueue time (in milliseconds) during the network waiting period.', example='0.0'),
      avgPartitionCount?: double(name='AvgPartitionCount', description='Average number of partition accessed during the execution period.', example='1'),
      avgQueueTime?: double(name='AvgQueueTime', description='Average queueing time (in milliseconds) during the execution period.', example='0.01'),
      avgReturnRows?: long(name='AvgReturnRows', description='Average number of rows returned during the execution period.', example='0.0'),
      avgRowCacheHit?: long(name='AvgRowCacheHit', description='Average RowCache hit count during the execution period.', example='0.0'),
      avgRpcCount?: long(name='AvgRpcCount', description='Average number of RPC sent during the execution.', example='8.0'),
      avgScheduleTime?: double(name='AvgScheduleTime', description='Average Schedule event wait time (in milliseconds) during the scheduling period.', example='0.0'),
      avgSsstoreReadRows?: long(name='AvgSsstoreReadRows', description='Average Ssstore read rows during the execution period.', example='0.0'),
      avgUsedWorkerCount?: double(name='AvgUsedWorkerCount', description='Average number of threads used of the SQL during the execution period.', example='3'),
      avgUserIoWaitTime?: double(name='AvgUserIoWaitTime', description='Average UserIO event wait time (in milliseconds) during the execution period.', example='0.0'),
      avgWaitCount?: double(name='AvgWaitCount', description='Average number of waits during the execution period.', example='0'),
      avgWaitTime?: double(name='AvgWaitTime', description='Average wait time (in milliseconds) during the execution period.', example='1442.49'),
      dbName?: string(name='DbName', description='The name of the database.', example='test_db'),
      distPlanPercentage?: double(name='DistPlanPercentage', description='Distributed plan percentage during the execution period.', example='100'),
      execPs?: double(name='ExecPs', description='Average execution count per second during the execution period.', example='0.31'),
      executions?: long(name='Executions', description='Total number of executions during the execution period.', example='1'),
      failCount?: long(name='FailCount', description='The total number of errors during the execution period.', example='0'),
      failPercentage?: double(name='FailPercentage', description='Error percentage during the execution period.', example='0'),
      localPlanPercentage?: double(name='LocalPlanPercentage', description='Local plan percentage during the execution period.', example='0'),
      maxAffectedRows?: double(name='MaxAffectedRows', description='Max updated rows during the execution period.', example='10000'),
      maxApplicationWaitTime?: double(name='MaxApplicationWaitTime', description='Max Application event wait time (in milliseconds) during the execution period', example='0'),
      maxConcurrencyWaitTime?: double(name='MaxConcurrencyWaitTime', description='Max Concurrency event wait time (in milliseconds) during the execution period', example='0'),
      maxCpuTime?: double(name='MaxCpuTime', description='Max CPU time.', example='13641.9'),
      maxDiskReads?: double(name='MaxDiskReads', description='Max physical read count during the execution period.', example='0'),
      maxElapsedTime?: double(name='MaxElapsedTime', description='Max response time.', example='13643.3'),
      maxReturnRows?: double(name='MaxReturnRows', description='Max returned rows during the execution period.', example='0'),
      maxUserIoWaitTime?: double(name='MaxUserIoWaitTime', description='Max UserIO event wait time (in milliseconds) during the execution period', example='0'),
      maxWaitTime?: double(name='MaxWaitTime', description='Max wait time (in milliseconds) during the execution period.', example='3.4'),
      missPlanPercentage?: double(name='MissPlanPercentage', description='Plan hit rage during the execution period.', example='0'),
      missPlans?: long(name='MissPlans', description='Missed plan count.', example='0'),
      remotePlanPercentage?: double(name='RemotePlanPercentage', description='Remote plan percentage during the execution period.', example='0'),
      remotePlans?: long(name='RemotePlans', description='Remote plan count.', example='0'),
      retCode4012Count?: double(name='RetCode4012Count', description='Number of occurrences of code 4012 during the execution period.', example='0'),
      retCode4013Count?: double(name='RetCode4013Count', description='Number of occurrences of code 4013 during the execution period.', example='0'),
      retCode5001Count?: double(name='RetCode5001Count', description='Number of occurrences of code 5001 during the execution period.', example='0'),
      retCode5024Count?: double(name='RetCode5024Count', description='Number of occurrences of code 5024 during the execution period.', example='0'),
      retCode5167Count?: double(name='RetCode5167Count', description='Number of occurrences of code 5167 during the execution period.', example='0'),
      retCode5217Count?: double(name='RetCode5217Count', description='Number of occurrences of code 5217 during the execution period.', example='0'),
      retCode6002Count?: double(name='RetCode6002Count', description='Number of occurrences of code 6002 during the execution period.', example='0'),
      retryCount?: long(name='RetryCount', description='Total number of retries during the execution period.', example='0'),
      SQLId?: string(name='SQLId', description='SQL ID.', example='8D6E84****0B8FB1823D199E2CA1****'),
      server?: string(name='Server', description='The server where the SQL is executed.', example='i-bp1db1****8uemejio'),
      strongConsistencyPercentage?: double(name='StrongConsistencyPercentage', description='Strong consistent transaction percentage during the execution period.', example='100'),
      sumDbTime?: double(name='SumDbTime', description='The total DB time, in milliseconds.', example='100'),
      sumElapsedTime?: double(name='SumElapsedTime', description='Total response time (in milliseconds) during the execution period.', example='11452126.36'),
      sumLogicalReads?: double(name='SumLogicalReads', description='Total logical reads.', example='0'),
      sumWaitTime?: double(name='SumWaitTime', description='The total wait time (in milliseconds) during the internal waiting period.', example='9421.73'),
      tableScanPercentage?: double(name='TableScanPercentage', description='Table scan percentage during the execution period.', example='0'),
      timestamp?: string(name='Timestamp', description='Timestamp for the sample.', example='2023-04-12T04:46:38Z'),
      userName?: string(name='UserName', description='Username.', example='test_user'),
      waitEvent?: string(name='WaitEvent', description='The wait event.', example='none'),
      weakConsistencyPercentage?: double(name='WeakConsistencyPercentage', description='Eventually consistent transaction percentage during the execution period.', example='0'),
    }
  ](name='Data', description='The list of SQL execution history.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeOasSQLHistoryListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOasSQLHistoryListResponseBody(name='body'),
}

/**
 * @summary You can call this API to view the SQL execution history.
 *
 * @param request DescribeOasSQLHistoryListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOasSQLHistoryListResponse
 */
async function describeOasSQLHistoryListWithOptions(request: DescribeOasSQLHistoryListRequest, runtime: Util.RuntimeOptions): DescribeOasSQLHistoryListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    body['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.dynamicSql)) {
    body['DynamicSql'] = request.dynamicSql;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.nodeIp)) {
    body['NodeIp'] = request.nodeIp;
  }
  if (!Util.isUnset(request.sqlId)) {
    body['SqlId'] = request.sqlId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOasSQLHistoryList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this API to view the SQL execution history.
 *
 * @param request DescribeOasSQLHistoryListRequest
 * @return DescribeOasSQLHistoryListResponse
 */
async function describeOasSQLHistoryList(request: DescribeOasSQLHistoryListRequest): DescribeOasSQLHistoryListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOasSQLHistoryListWithOptions(request, runtime);
}

model DescribeOasSQLPlansRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='Supported language. Valid values:
- zh-CN: Chinese
- en-US: English', example='zh-CN'),
  dbName?: string(name='DbName', description='The name of the database.

This parameter is required.', example='test_db'),
  dynamicSql?: boolean(name='DynamicSql', description='Specifies whether the SQL statement is dynamic.', example='false'),
  endTime?: string(name='EndTime', description='The end time of querying the SQL execution plan.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T05:38:38Z'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  planUnionHash?: string(name='PlanUnionHash', description='The unique identifier of the execution plan.', example='c4e9aaa797428df9a5a41828********'),
  returnBriefInfo?: boolean(name='ReturnBriefInfo', description='Specifies whether to return an overview of the execution plan.', example='true'),
  sqlId?: string(name='SqlId', description='SQL ID.

This parameter is required.', example='8D6E84****0B8FB1823D199E2CA1****'),
  startTime?: string(name='StartTime', description='The start time of querying the SQL execution plan.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T04:38:38Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model DescribeOasSQLPlansResponseBody = {
  data?: [ 
    {
      avgCpuTime?: double(name='AvgCpuTime', description='Average CPU time (in milliseconds) during the execution period.', example='1875.34'),
      bounded?: boolean(name='Bounded', description='Whether to bind the execution plan.', example='false'),
      executions?: long(name='Executions', description='Execution count.', example='1'),
      firstLoadTime?: string(name='FirstLoadTime', description='First loading time.', example='2023-04-12T04:46:38Z'),
      hitDiagnosis?: boolean(name='HitDiagnosis', description='Whether to hit the diagnosis.', example='false'),
      hitPercentage?: double(name='HitPercentage', description='Hit rate.', example='100.0'),
      mergedVersion?: long(name='MergedVersion', description='Merge version.', example='513'),
      outlineId?: string(name='OutlineId', description='The ID of the outline used by the execution plan.', example='3********'),
      outlineStatus?: string(name='OutlineStatus', description='The outline status of the execution plan. Valid values:
* **Effective**: indicates that the outline_data and outlIne_content fields exactly match with each other. 
* **Unknown**: indicates that the outline status is unknown.', example='Effective'),
      planExplain?: {
        planJsonString?: string(name='PlanJsonString', description='JSON string of the SQL execution plan.', example='{\\\\"RootOperations\\\\":[{\\\\"Children\\\\'),
      }(name='PlanExplain', description='Execution plan.'),
      planHash?: string(name='PlanHash', description='The internal identifier of the SQL execution plan in the diagnostic system.', example='1758****24913166****'),
      planType?: string(name='PlanType', description='Execution plan type.', example='LOCAL'),
      planUnionHash?: string(name='PlanUnionHash', description='The internal unique identifier of the SQL execution plan in the diagnostic system.', example='"52c7c53****53e61b3f7586b17****ad"'),
      plans?: [ 
        {
          avgApplicationWaitTime?: double(name='AvgApplicationWaitTime', description='Average Application event waiting time (in milliseconds) during the execution period.', example='0.0'),
          avgBufferGets?: double(name='AvgBufferGets', description='Average cache read count during the execution period.', example='30137.03'),
          avgConcurrencyWaitTime?: double(name='AvgConcurrencyWaitTime', description='Average Concurrency event waiting time (in milliseconds) during the execution period.', example='0.0'),
          avgCpuTime?: double(name='AvgCpuTime', description='Average CPU time (in milliseconds) during the execution period.', example='1875.34'),
          avgDiskReads?: double(name='AvgDiskReads', description='The average physical read count during the execution period.', example='0.0'),
          avgDiskWrites?: double(name='AvgDiskWrites', description='The average physical write count during the execution period.', example='0.0'),
          avgElapsedTime?: double(name='AvgElapsedTime', description='Average interval waiting time (in milliseconds) during the execution period.', example='1876.78'),
          avgRowProcessed?: double(name='AvgRowProcessed', description='Average row processing waiting time (in milliseconds) during the execution period.', example='1.0'),
          avgUserIoWaitTime?: double(name='AvgUserIoWaitTime', description='Average UserIo event waiting time (in milliseconds) during the execution period.', example='0.0'),
          collectTimeUs?: long(name='CollectTimeUs', description='Collection time.', example='1684368****00000'),
          delayedLargeQueryPercentage?: double(name='DelayedLargeQueryPercentage', description='Percentage of delayed long-running queries.', example='0.0'),
          execPs?: double(name='ExecPs', description='The average execution count per second during the execution period.', example='0.31'),
          executions?: long(name='Executions', description='The total number of executions during the execution period.', example='1'),
          firstLoadTime?: string(name='FirstLoadTime', description='First time to load the plan.', example='2023-04-12T04:46:38Z'),
          firstLoadTimeUs?: long(name='FirstLoadTimeUs', description='First loading time.', example='1684****03289441'),
          hitDiagnosis?: boolean(name='HitDiagnosis', description='Whether to hit the diagnosis.', example='false'),
          hitPercentage?: double(name='HitPercentage', description='Hit rate.', example='100.0'),
          largeQueryPercentage?: double(name='LargeQueryPercentage', description='Percentage of completed long-running queries.', example='0.0'),
          mergedVersion?: long(name='MergedVersion', description='Merge version.', example='513'),
          obDbId?: long(name='ObDbId', description='Database ID.', example='11006****828'),
          obServerId?: long(name='ObServerId', description='Server ID.', example='2'),
          outlineData?: string(name='OutlineData', description='The outline_data parameter of the SQL execution plan.', example='/*+ BEGIN_OUTLINE_DATA INDEX(@\\\\"SEL$1\\\\'),
          outlineId?: long(name='OutlineId', description='Outline ID.', example='-1'),
          planHash?: string(name='PlanHash', description='The internal identifier of the SQL execution plan in the diagnostic system.', example='-86290582****886880'),
          planId?: long(name='PlanId', description='The ID of the plan.', example='590****'),
          planSize?: long(name='PlanSize', description='Plan size.', example='10****'),
          planType?: string(name='PlanType', description='Plan type, including LOCAL, REMOTE, DIST.', example='LOCAL'),
          planUnionHash?: string(name='PlanUnionHash', description='The internal unique identifier of the SQL execution plan in the diagnostic system.', example='"52c7c53****53e61b3f7586b17****ad"'),
          schemaVersion?: long(name='SchemaVersion', description='Schema version.', example='16838****3550464'),
          server?: string(name='Server', description='The server where the SQL is executed.', example='i-bp1db1a9us038****jio'),
          serverId?: long(name='ServerId', description='The ID of the backend server instance.', example='2'),
          sqlId?: string(name='SqlId', description='SQL ID.', example='46939C87ECA****95ED0FF64F44B****'),
          tableScan?: boolean(name='TableScan', description='Whether a full table scan is performed.', example='false'),
          timeoutPercentage?: double(name='TimeoutPercentage', description='Percentage of timeouts.', example='0.0'),
          uid?: string(name='Uid', description='The unique identifier of the plan.', example='AAAAAAAAAAI****AAFoT2QAF--7W****'),
        }
      ](name='Plans', description='The list of the execution plan.'),
      querySql?: string(name='QuerySql', description='The SQL for the query.', example='"select 1 from t"'),
      tableScan?: boolean(name='TableScan', description='Indicates whether full table scan is performed.', example='false'),
    }
  ](name='Data', description='The list of SQL execution plan.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeOasSQLPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOasSQLPlansResponseBody(name='body'),
}

/**
 * @summary You can call this API to retrieve information about the SQL execution plan stored in the diagnostic system based on the SQL ID.
 *
 * @param request DescribeOasSQLPlansRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOasSQLPlansResponse
 */
async function describeOasSQLPlansWithOptions(request: DescribeOasSQLPlansRequest, runtime: Util.RuntimeOptions): DescribeOasSQLPlansResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    body['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.dynamicSql)) {
    body['DynamicSql'] = request.dynamicSql;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.planUnionHash)) {
    body['PlanUnionHash'] = request.planUnionHash;
  }
  if (!Util.isUnset(request.returnBriefInfo)) {
    body['ReturnBriefInfo'] = request.returnBriefInfo;
  }
  if (!Util.isUnset(request.sqlId)) {
    body['SqlId'] = request.sqlId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOasSQLPlans',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this API to retrieve information about the SQL execution plan stored in the diagnostic system based on the SQL ID.
 *
 * @param request DescribeOasSQLPlansRequest
 * @return DescribeOasSQLPlansResponse
 */
async function describeOasSQLPlans(request: DescribeOasSQLPlansRequest): DescribeOasSQLPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOasSQLPlansWithOptions(request, runtime);
}

model DescribeOasSlowSQLListRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The language of the response.', example='zh-CN'),
  dbName?: string(name='DbName', description='The name of the database.', example='test_db'),
  dynamicSql?: boolean(name='DynamicSql'),
  endTime?: string(name='EndTime', description='The end time of querying slow SQL historical parameters.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T05:38:38Z'),
  filterCondition?: string(name='FilterCondition', description='All parameters are referenced by the symbol @. For a list of available parameters, refer to the returned parameters in [Query performance indicators of an SQL statement](https://en.oceanbase.com/docs/community-ocp-en-10000000000840290).', example='@avgCpuTime > 20 and @executions > 100'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  mergeDynamicSql?: boolean(name='MergeDynamicSql'),
  nodeIp?: string(name='NodeIp', description='The IP of the database node.', example='i-bp18qljorblo8es*****'),
  searchKeyWord?: string(name='SearchKeyWord', description='The search keyword.', example='update'),
  searchParam?: string(name='SearchParam', description='The search parameter.', example='cputime'),
  searchRule?: string(name='SearchRule', description='The search rule.', example='>'),
  searchValue?: string(name='SearchValue', description='The search value.', example='0.01'),
  sqlId?: string(name='SqlId', description='SQL ID, the unique identifier of the SQL.', example='8D6E84****0B8FB1823D199E2CA1****'),
  sqlTextLength?: long(name='SqlTextLength', description='Max length of the returned SQL text.', example='65535'),
  startTime?: string(name='StartTime', description='The start time of querying slow SQL historical parameters.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T04:38:38Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model DescribeOasSlowSQLListResponseBody = {
  data?: [ 
    {
      avgAffectedRows?: double(name='AvgAffectedRows', description='Average updated rows during the execution period.', example='9978.75'),
      avgApplicationWaitTime?: double(name='AvgApplicationWaitTime', description='Average Application event wait time (in milliseconds) during the client waiting period.', example='0.0'),
      avgBlockCacheHit?: double(name='AvgBlockCacheHit', description='Average BlockCache hit count during the execution period.', example='0.0'),
      avgBlockIndexCacheHit?: double(name='AvgBlockIndexCacheHit', description='Average BlockIndexCache hit count during the execution period.', example='0.0'),
      avgBloomFilterCacheHit?: double(name='AvgBloomFilterCacheHit', description='Average BloomFilterCache hit count during the execution period.', example='0.0'),
      avgConcurrencyWaitTime?: double(name='AvgConcurrencyWaitTime', description='Average Concurrency event wait time (in milliseconds) during the execution period.', example='0.0'),
      avgCpuTime?: double(name='AvgCpuTime', description='Average CPU time (in milliseconds) during the execution period.', example='1875.34'),
      avgDbTime?: double(name='AvgDbTime'),
      avgDecodeTime?: double(name='AvgDecodeTime', description='Average syntax parsing time (in milliseconds) during the execution period.', example='0.0'),
      avgDiskReads?: double(name='AvgDiskReads', description='Average physical read count during the execution period.', example='0.0'),
      avgElapsedTime?: double(name='AvgElapsedTime', description='Average response time (in milliseconds) during the execution period.', example='1876.78'),
      avgExecuteTime?: double(name='AvgExecuteTime', description='Average plan execution time (in milliseconds) during the execution period.', example='1895.7'),
      avgExecutorRpcCount?: double(name='AvgExecutorRpcCount', description='Average number of RPC requests executed during the execution period.', example='0.0'),
      avgExpectedWorkerCount?: double(name='AvgExpectedWorkerCount', description='Average degree of parallelism during the execution period.', example='3'),
      avgGetPlanTime?: double(name='AvgGetPlanTime', description='Average plan generation time (in milliseconds) during the execution period.', example='0.0'),
      avgLogicalReads?: double(name='AvgLogicalReads', description='Average logical reads of the SQL during the execution period.', example='0.0'),
      avgMemstoreReadRows?: double(name='AvgMemstoreReadRows', description='Strong consistent transaction percentage during the execution period.', example='0.0'),
      avgNetTime?: double(name='AvgNetTime', description='Average network transmission time (in milliseconds) during the execution period.', example='0.0'),
      avgNetWaitTime?: double(name='AvgNetWaitTime', description='Average network enqueue time (in milliseconds) during the network waiting period.', example='0.0'),
      avgPartitionCount?: double(name='AvgPartitionCount', description='Average number of partition accessed during the execution period.', example='1.0'),
      avgQueueTime?: double(name='AvgQueueTime', description='Average queueing time (in milliseconds) during the execution period.', example='0.01'),
      avgReturnRows?: double(name='AvgReturnRows', description='Average number of rows returned during the execution period.', example='0.0'),
      avgRowCacheHit?: double(name='AvgRowCacheHit', description='Average RowCache hit count during the execution period.', example='0.0'),
      avgRpcCount?: double(name='AvgRpcCount', description='Average number of RPC sent during the execution.', example='8.0'),
      avgScheduleTime?: double(name='AvgScheduleTime', description='Average Schedule event wait time (in milliseconds) during the scheduling period.', example='0.0'),
      avgSsstoreReadRows?: double(name='AvgSsstoreReadRows', description='Eventually consistent transaction percentage during the execution period.', example='0.0'),
      avgUsedWorkerCount?: double(name='AvgUsedWorkerCount', description='Average number of threads used of the SQL during the execution period.', example='3'),
      avgUserIoWaitTime?: double(name='AvgUserIoWaitTime', description='Average UserIO event wait time (in milliseconds) during the execution period.', example='0.0'),
      avgWaitCount?: double(name='AvgWaitCount', description='Average number of waits during the execution period.', example='0.0'),
      avgWaitTime?: double(name='AvgWaitTime', description='Average wait time (in milliseconds) during the execution period.', example='1.42'),
      clientIp?: string(name='ClientIp', description='Client IP.', example='1*2.***.1*3.***'),
      dbName?: string(name='DbName', description='The name of the database.', example='test_db'),
      distPlanPercentage?: double(name='DistPlanPercentage', description='Distributed plan percentage during the execution period.', example='100.0'),
      dynamicSql?: boolean(name='DynamicSql'),
      execPs?: double(name='ExecPs', description='Average execution count per second during the execution period.', example='0.31'),
      executions?: double(name='Executions', description='Total number of executions during the execution period.', example='1'),
      failCount?: double(name='FailCount', description='Average number of partition accessed during the execution period.', example='0'),
      failPercentage?: double(name='FailPercentage', description='Error percentage during the execution period.', example='0.0'),
      inner?: boolean(name='Inner', description='Whether an internal SQL.', example='false'),
      localPlanPercentage?: double(name='LocalPlanPercentage', description='Local plan percentage during the execution period.', example='0.0'),
      maxAffectedRows?: double(name='MaxAffectedRows', description='Max affected rows during the execution period.', example='10000.0'),
      maxApplicationWaitTime?: double(name='MaxApplicationWaitTime', description='Max Application event wait time (in milliseconds) during the execution period', example='0.0'),
      maxConcurrencyWaitTime?: double(name='MaxConcurrencyWaitTime', description='Max Concurrency event wait time (in milliseconds) during the execution period', example='0.0'),
      maxCpuTime?: double(name='MaxCpuTime', description='Max CPU time.', example='257.967'),
      maxDiskReads?: double(name='MaxDiskReads', description='Max physical read count during the execution period.', example='0.0'),
      maxElapsedTime?: double(name='MaxElapsedTime', description='Max response time during the execution period.', example='260.044'),
      maxReturnRows?: double(name='MaxReturnRows', description='Max returned rows during the execution period.', example='0.0'),
      maxUserIoWaitTime?: double(name='MaxUserIoWaitTime', description='Max UserIO event wait time (in milliseconds) during the execution period.', example='0.0'),
      maxWaitTime?: double(name='MaxWaitTime', description='Max wait time (in milliseconds) during the execution period.', example='3.4'),
      missPlanPercentage?: double(name='MissPlanPercentage', description='Plan hit rage during the execution period.', example='0.0'),
      missPlans?: double(name='MissPlans', description='Missed hit count of the execution plan during the execution period.', example='0'),
      remotePlanPercentage?: double(name='RemotePlanPercentage', description='Remote plan percentage during the execution period.', example='0.0'),
      remotePlans?: double(name='RemotePlans', description='Remote execution count during the execution period.', example='0'),
      retCode4012Count?: long(name='RetCode4012Count', description='Number of occurrences of code 4012 during the execution period.', example='0'),
      retCode4013Count?: long(name='RetCode4013Count', description='Number of occurrences of code 4013 during the execution period.', example='0'),
      retCode5001Count?: double(name='RetCode5001Count', description='Number of occurrences of code 5001 during the execution period.', example='0'),
      retCode5024Count?: double(name='RetCode5024Count', description='Number of occurrences of code 5024 during the execution period.', example='0'),
      retCode5167Count?: double(name='RetCode5167Count', description='Number of occurrences of code 5167 during the execution period.', example='0'),
      retCode5217Count?: double(name='RetCode5217Count', description='Number of occurrences of code 5217 during the execution period.', example='0'),
      retCode6002Count?: double(name='RetCode6002Count', description='Number of occurrences of code 6002 during the execution period.', example='0'),
      retryCount?: double(name='RetryCount', description='Total number of retries during the execution period.', example='5'),
      rpcCount?: double(name='RpcCount', description='RPC count during the execution period.', example='0'),
      server?: string(name='Server', description='The server where the SQL is executed.', example='i-bp1db1a**s038**mej**'),
      serverIp?: string(name='ServerIp', description='The IP address of the server.', example='i-bp1db1a**s038**mej**'),
      serverPort?: long(name='ServerPort', description='The server port where the SQL is executed.', example='10110'),
      sqlId?: string(name='SqlId', description='SQL ID.', example='8D6E84****0B8FB1823D199E2CA1****'),
      sqlList?: [ 
        {
          avgAffectedRows?: double(name='AvgAffectedRows'),
          avgApplicationWaitTime?: double(name='AvgApplicationWaitTime'),
          avgBlockCacheHit?: double(name='AvgBlockCacheHit'),
          avgBlockIndexCacheHit?: double(name='AvgBlockIndexCacheHit'),
          avgBloomFilterCacheHit?: double(name='AvgBloomFilterCacheHit'),
          avgConcurrencyWaitTime?: double(name='AvgConcurrencyWaitTime'),
          avgCpuTime?: double(name='AvgCpuTime'),
          avgDbTime?: double(name='AvgDbTime'),
          avgDecodeTime?: double(name='AvgDecodeTime'),
          avgDiskReads?: double(name='AvgDiskReads'),
          avgElapsedTime?: double(name='AvgElapsedTime'),
          avgExecuteTime?: double(name='AvgExecuteTime'),
          avgExecutorRpcCount?: double(name='AvgExecutorRpcCount'),
          avgExpectedWorkerCount?: double(name='AvgExpectedWorkerCount'),
          avgGetPlanTime?: double(name='AvgGetPlanTime'),
          avgLogicalReads?: double(name='AvgLogicalReads'),
          avgMemstoreReadRows?: double(name='AvgMemstoreReadRows'),
          avgNetTime?: double(name='AvgNetTime'),
          avgNetWaitTime?: double(name='AvgNetWaitTime'),
          avgPartitionCount?: double(name='AvgPartitionCount'),
          avgQueueTime?: double(name='AvgQueueTime'),
          avgReturnRows?: double(name='AvgReturnRows'),
          avgRowCacheHit?: double(name='AvgRowCacheHit'),
          avgRpcCount?: double(name='AvgRpcCount'),
          avgScheduleTime?: double(name='AvgScheduleTime'),
          avgSsstoreReadRows?: double(name='AvgSsstoreReadRows'),
          avgUsedWorkerCount?: double(name='AvgUsedWorkerCount'),
          avgUserIoWaitTime?: double(name='AvgUserIoWaitTime'),
          avgWaitCount?: double(name='AvgWaitCount'),
          avgWaitTime?: double(name='AvgWaitTime'),
          clientIp?: string(name='ClientIp'),
          dbName?: string(name='DbName'),
          distPlanPercentage?: double(name='DistPlanPercentage'),
          execPs?: double(name='ExecPs'),
          executions?: double(name='Executions'),
          failCount?: double(name='FailCount'),
          failPercentage?: double(name='FailPercentage'),
          inner?: boolean(name='Inner'),
          localPlanPercentage?: double(name='LocalPlanPercentage'),
          maxAffectedRows?: double(name='MaxAffectedRows'),
          maxApplicationWaitTime?: double(name='MaxApplicationWaitTime'),
          maxConcurrencyWaitTime?: double(name='MaxConcurrencyWaitTime'),
          maxCpuTime?: double(name='MaxCpuTime'),
          maxDiskReads?: double(name='MaxDiskReads'),
          maxElapsedTime?: double(name='MaxElapsedTime'),
          maxReturnRows?: double(name='MaxReturnRows'),
          maxUserIoWaitTime?: double(name='MaxUserIoWaitTime'),
          maxWaitTime?: double(name='MaxWaitTime'),
          missPlanPercentage?: double(name='MissPlanPercentage'),
          missPlans?: double(name='MissPlans'),
          remotePlanPercentage?: double(name='RemotePlanPercentage'),
          remotePlans?: double(name='RemotePlans'),
          retCode4012Count?: long(name='RetCode4012Count'),
          retCode4013Count?: long(name='RetCode4013Count'),
          retCode5001Count?: long(name='RetCode5001Count'),
          retCode5024Count?: long(name='RetCode5024Count'),
          retCode5167Count?: long(name='RetCode5167Count'),
          retCode5217Count?: long(name='RetCode5217Count'),
          retCode6002Count?: long(name='RetCode6002Count'),
          retryCount?: double(name='RetryCount'),
          rpcCount?: double(name='RpcCount'),
          server?: string(name='Server'),
          serverIp?: string(name='ServerIp'),
          serverPort?: long(name='ServerPort'),
          sqlId?: string(name='SqlId'),
          sqlTextShort?: string(name='SqlTextShort'),
          sqlType?: string(name='SqlType'),
          strongConsistencyPercentage?: double(name='StrongConsistencyPercentage'),
          sumDbTime?: double(name='SumDbTime'),
          sumElapsedTime?: double(name='SumElapsedTime'),
          sumLogicalReads?: double(name='SumLogicalReads'),
          sumWaitTime?: double(name='SumWaitTime'),
          tableScanPercentage?: double(name='TableScanPercentage'),
          totalWaitTime?: double(name='TotalWaitTime'),
          userName?: string(name='UserName'),
          waitEvent?: string(name='WaitEvent'),
          weakConsistencyPercentage?: double(name='WeakConsistencyPercentage'),
        }
      ](name='SqlList'),
      sqlTextShort?: string(name='SqlTextShort', description='SQL text (the first 100 characters).', example='select a from b where'),
      sqlType?: string(name='SqlType', description='SQL type.', example='select'),
      strongConsistencyPercentage?: double(name='StrongConsistencyPercentage', description='Strong consistent transaction percentage during the execution period.', example='100.0'),
      sumDbTime?: double(name='SumDbTime'),
      sumElapsedTime?: double(name='SumElapsedTime', description='Total response time (in milliseconds) during the execution period.', example='11452126.36'),
      sumLogicalReads?: double(name='SumLogicalReads', description='Total logical reads of the SQL during the execution period.', example='0.0'),
      sumWaitTime?: double(name='SumWaitTime', description='The total wait time (in milliseconds) during the internal waiting period.', example='9421.73'),
      tableScanPercentage?: double(name='TableScanPercentage', description='Table scan percentage during the execution period.', example='0.0'),
      totalWaitTime?: double(name='TotalWaitTime', description='Total wait time during the execution period.', example='10.966'),
      userName?: string(name='UserName', description='Username.', example='test_user'),
      waitEvent?: string(name='WaitEvent', description='Longest wait event during the execution period.', example='none'),
      weakConsistencyPercentage?: double(name='WeakConsistencyPercentage', description='Eventually consistent transaction percentage during the execution period.', example='0.0'),
    }
  ](name='Data', description='The list of slow queries.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeOasSlowSQLListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOasSlowSQLListResponseBody(name='body'),
}

/**
 * @summary You can call this API to view a list of slow queries.
 *
 * @param request DescribeOasSlowSQLListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOasSlowSQLListResponse
 */
async function describeOasSlowSQLListWithOptions(request: DescribeOasSlowSQLListRequest, runtime: Util.RuntimeOptions): DescribeOasSlowSQLListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    body['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.dynamicSql)) {
    body['DynamicSql'] = request.dynamicSql;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.filterCondition)) {
    body['FilterCondition'] = request.filterCondition;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.mergeDynamicSql)) {
    body['MergeDynamicSql'] = request.mergeDynamicSql;
  }
  if (!Util.isUnset(request.nodeIp)) {
    body['NodeIp'] = request.nodeIp;
  }
  if (!Util.isUnset(request.searchKeyWord)) {
    body['SearchKeyWord'] = request.searchKeyWord;
  }
  if (!Util.isUnset(request.searchParam)) {
    body['SearchParam'] = request.searchParam;
  }
  if (!Util.isUnset(request.searchRule)) {
    body['SearchRule'] = request.searchRule;
  }
  if (!Util.isUnset(request.searchValue)) {
    body['SearchValue'] = request.searchValue;
  }
  if (!Util.isUnset(request.sqlId)) {
    body['SqlId'] = request.sqlId;
  }
  if (!Util.isUnset(request.sqlTextLength)) {
    body['SqlTextLength'] = request.sqlTextLength;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOasSlowSQLList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this API to view a list of slow queries.
 *
 * @param request DescribeOasSlowSQLListRequest
 * @return DescribeOasSlowSQLListResponse
 */
async function describeOasSlowSQLList(request: DescribeOasSlowSQLListRequest): DescribeOasSlowSQLListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOasSlowSQLListWithOptions(request, runtime);
}

model DescribeOasTopSQLListRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The language of the response. Valid values:

- zh: Chinese
- en: English', example='zh-CN'),
  dbName?: string(name='DbName', description='The name of the database.', example='test_db'),
  dynamicSql?: boolean(name='DynamicSql'),
  endTime?: string(name='EndTime', description='The end time of querying the TOPSQL parameter.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T05:38:38Z'),
  filterCondition?: string(name='FilterCondition', description='All parameters are referenced by the symbol @. For a list of available parameters, refer to the returned parameters in [Query performance indicators of an SQL statement](https://en.oceanbase.com/docs/community-ocp-en-10000000000840290).', example='@avgCpuTime > 20 and @executions > 100'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  mergeDynamicSql?: boolean(name='MergeDynamicSql'),
  nodeIp?: string(name='NodeIp', description='The node IP.', example='i-bp18l4****str4uk03'),
  searchKeyWord?: string(name='SearchKeyWord', description='The search keyword.', example='update'),
  searchParam?: string(name='SearchParam', description='The search parameter.', example='cputime'),
  searchRule?: string(name='SearchRule', description='The search rule.', example='>'),
  searchValue?: string(name='SearchValue', description='The search value.', example='0.01'),
  sqlId?: string(name='SqlId', description='SQL ID.
> When the SQL ID is provided, the system collects all the request data for the target SQL ID. When the SQL ID is empty, the system collects all the request data for the entire database instance.', example='8D6E84****0B8FB1823D199E2CA1****'),
  sqlTextLength?: long(name='SqlTextLength', description='Max length of the returned SQL text.', example='65535'),
  startTime?: string(name='StartTime', description='The start time of querying the TOPSQL parameter.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T04:38:38Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model DescribeOasTopSQLListResponseBody = {
  data?: [ 
    {
      avgAffectedRows?: double(name='AvgAffectedRows', description='Average updated rows during the execution period.', example='9978.75'),
      avgApplicationWaitTime?: double(name='AvgApplicationWaitTime', description='Average Application event wait time (in milliseconds) during the execution period.', example='0.0'),
      avgBlockCacheHit?: double(name='AvgBlockCacheHit', description='Average BlockCache hit count during the execution period.', example='0.0'),
      avgBlockIndexCacheHit?: double(name='AvgBlockIndexCacheHit', description='Average BlockIndexCache hit count during the execution period.', example='0.0'),
      avgBloomFilterCacheHit?: double(name='AvgBloomFilterCacheHit', description='Average BloomFilterCache hit count during the execution period.', example='0.0'),
      avgConcurrencyWaitTime?: double(name='AvgConcurrencyWaitTime', description='Average Concurrency event wait time (in milliseconds) during the execution period.', example='0.0'),
      avgCpuTime?: double(name='AvgCpuTime', description='Average CPU time (in milliseconds) during the execution period.', example='1875.34'),
      avgDbTime?: double(name='AvgDbTime'),
      avgDecodeTime?: double(name='AvgDecodeTime', description='Average syntax parsing time (in milliseconds) during the execution period.', example='0.0'),
      avgDiskReads?: double(name='AvgDiskReads', description='Average physical read count during the execution period.', example='0.0'),
      avgElapsedTime?: double(name='AvgElapsedTime', description='Average response time (in milliseconds) during the execution period.', example='903.29'),
      avgExecuteTime?: double(name='AvgExecuteTime', description='Average plan execution time (in milliseconds) during the execution period.', example='1895.7'),
      avgExecutorRpcCount?: double(name='AvgExecutorRpcCount', description='Average number of RPC requests executed during the execution period.', example='0.0'),
      avgExpectedWorkerCount?: double(name='AvgExpectedWorkerCount', description='Average degree of parallelism during the execution period.', example='3'),
      avgGetPlanTime?: double(name='AvgGetPlanTime', description='Average plan generation time (in milliseconds) during the execution period.', example='0.0'),
      avgLogicalReads?: double(name='AvgLogicalReads', description='Average logical reads of the SQL during the execution period.', example='0.0'),
      avgMemstoreReadRows?: double(name='AvgMemstoreReadRows', description='Strong consistent transaction percentage during the execution period.', example='0.0'),
      avgNetTime?: double(name='AvgNetTime', description='Average network transmission time (in milliseconds) during the execution period.', example='0.0'),
      avgNetWaitTime?: double(name='AvgNetWaitTime', description='Average network enqueue time (in milliseconds) during the execution period.', example='0.0'),
      avgPartitionCount?: double(name='AvgPartitionCount', description='Average number of partition accessed during the execution period.', example='1.0'),
      avgQueueTime?: double(name='AvgQueueTime', description='Average queueing time (in milliseconds) during the execution period.', example='0.01'),
      avgReturnRows?: double(name='AvgReturnRows', description='Average returned rows during the execution period.', example='0.0'),
      avgRowCacheHit?: double(name='AvgRowCacheHit', description='Average RowCache hit count during the execution period.', example='0.0'),
      avgRpcCount?: double(name='AvgRpcCount', description='Average count of RPC sent during the execution period.', example='8.0'),
      avgScheduleTime?: double(name='AvgScheduleTime', description='Average Schedule event wait time (in milliseconds) during the execution period.', example='0.0'),
      avgSsstoreReadRows?: double(name='AvgSsstoreReadRows', description='Eventually consistent transaction percentage during the execution period.', example='0.0'),
      avgUsedWorkerCount?: double(name='AvgUsedWorkerCount', description='Average number of threads used of the SQL during the execution period.', example='3'),
      avgUserIoWaitTime?: double(name='AvgUserIoWaitTime', description='Average UserIO event wait time (in milliseconds) during the execution period.', example='0.0'),
      avgWaitCount?: double(name='AvgWaitCount', description='Average wait count during the execution period.', example='0.0'),
      avgWaitTime?: double(name='AvgWaitTime', description='Average wait time (in milliseconds) during the execution period.', example='1442.49'),
      clientIp?: string(name='ClientIp', description='Client IP.', example='i-bp1db****38uemejio'),
      cpuPercentage?: double(name='CpuPercentage', description='CPU percentage.', example='100.0'),
      dbName?: string(name='DbName', description='The name of the database.', example='test_db'),
      distPlanPercentage?: double(name='DistPlanPercentage', description='Distributed plan percentage during the execution period.', example='100.0'),
      dynamicSql?: boolean(name='DynamicSql'),
      execPs?: double(name='ExecPs', description='Average execution count per second during the execution period.', example='0.31'),
      executions?: long(name='Executions', description='Total number of executions during the execution period.', example='1'),
      failCount?: double(name='FailCount', description='Average number of partition accessed during the execution period.', example='0'),
      failPercentage?: double(name='FailPercentage', description='Error percentage during the execution period.', example='0.0'),
      inner?: boolean(name='Inner', description='Whether a internal SQL.', example='false'),
      lastFailCode?: long(name='LastFailCode'),
      localPlanPercentage?: double(name='LocalPlanPercentage', description='Local plan percentage during the execution period.', example='0.0'),
      maxAffectedRows?: double(name='MaxAffectedRows', description='Max affected rows during the execution period.', example='10000.0'),
      maxApplicationWaitTime?: double(name='MaxApplicationWaitTime', description='Max Application event wait time (in milliseconds) during the execution period.', example='0.0'),
      maxConcurrencyWaitTime?: double(name='MaxConcurrencyWaitTime', description='Max Concurrency event wait time (in milliseconds) during the execution period.', example='0.0'),
      maxCpuTime?: double(name='MaxCpuTime', description='Max CPU time (in milliseconds).', example='13641.9'),
      maxDiskReads?: double(name='MaxDiskReads', description='Max physical read count during the execution period.', example='0.0'),
      maxElapsedTime?: double(name='MaxElapsedTime', description='Max response time during the execution period.', example='13643.3'),
      maxReturnRows?: double(name='MaxReturnRows', description='Max returned rows during the execution period.', example='0.0'),
      maxUserIoWaitTime?: double(name='MaxUserIoWaitTime', description='Max UserIO event wait time (in milliseconds) during the execution period.', example='0.0'),
      maxWaitTime?: double(name='MaxWaitTime', description='Max wait time (in milliseconds) during the execution period.', example='3.4'),
      missPlanPercentage?: double(name='MissPlanPercentage', description='Plan hit rage during the execution period.', example='0.0'),
      missPlans?: double(name='MissPlans', description='Missed hit count of the execution plan during the execution period.', example='0'),
      remotePlanPercentage?: double(name='RemotePlanPercentage', description='Remote plan percentage during the execution period.', example='0.0'),
      remotePlans?: double(name='RemotePlans', description='Remote execution count during the execution period.', example='0'),
      retCode4012Count?: long(name='RetCode4012Count', description='Number of occurrences of the code 4012 during the execution period.', example='0'),
      retCode4013Count?: long(name='RetCode4013Count', description='Number of occurrences of the code 4013 during the execution period.', example='0'),
      retCode5001Count?: long(name='RetCode5001Count', description='Number of occurrences of the code 5001 during the execution period.', example='0'),
      retCode5024Count?: long(name='RetCode5024Count', description='Number of occurrences of the code 5024 during the execution period.', example='0'),
      retCode5167Count?: long(name='RetCode5167Count', description='Number of occurrences of the code 5167 during the execution period.', example='0'),
      retCode5217Count?: long(name='RetCode5217Count', description='Number of occurrences of the code 5217 during the execution period.', example='0'),
      retCode6002Count?: long(name='RetCode6002Count', description='Number of occurrences of the code 6002 during the execution period.', example='0'),
      retryCount?: double(name='RetryCount', description='Total retry count during the execution period.', example='0'),
      rpcCount?: double(name='RpcCount', description='RPC count during the execution period.', example='0.0'),
      server?: string(name='Server', description='The server where the SQL is executed.', example='i-bp1db1****8uemejio'),
      serverIp?: string(name='ServerIp', description='The server IP where the SQL is executed.', example='i-bp1db1****8uemejio'),
      serverPort?: long(name='ServerPort', description='The server port where the SQL is executed.', example='389'),
      sqlId?: string(name='SqlId', description='SQL ID.', example='8D6E84****0B8FB1823D199E2CA1****'),
      sqlList?: [ 
        {
          avgAffectedRows?: double(name='AvgAffectedRows'),
          avgApplicationWaitTime?: double(name='AvgApplicationWaitTime'),
          avgBlockCacheHit?: double(name='AvgBlockCacheHit'),
          avgBlockIndexCacheHit?: double(name='AvgBlockIndexCacheHit'),
          avgBloomFilterCacheHit?: double(name='AvgBloomFilterCacheHit'),
          avgConcurrencyWaitTime?: double(name='AvgConcurrencyWaitTime'),
          avgCpuTime?: double(name='AvgCpuTime'),
          avgDbTime?: double(name='AvgDbTime'),
          avgDecodeTime?: double(name='AvgDecodeTime'),
          avgDiskReads?: double(name='AvgDiskReads'),
          avgElapsedTime?: double(name='AvgElapsedTime'),
          avgExecuteTime?: double(name='AvgExecuteTime'),
          avgExecutorRpcCount?: double(name='AvgExecutorRpcCount'),
          avgExpectedWorkerCount?: double(name='AvgExpectedWorkerCount'),
          avgGetPlanTime?: double(name='AvgGetPlanTime'),
          avgLogicalReads?: double(name='AvgLogicalReads'),
          avgMemstoreReadRows?: double(name='AvgMemstoreReadRows'),
          avgNetTime?: double(name='AvgNetTime'),
          avgNetWaitTime?: double(name='AvgNetWaitTime'),
          avgPartitionCount?: double(name='AvgPartitionCount'),
          avgQueueTime?: double(name='AvgQueueTime'),
          avgReturnRows?: double(name='AvgReturnRows'),
          avgRowCacheHit?: double(name='AvgRowCacheHit'),
          avgRpcCount?: double(name='AvgRpcCount'),
          avgScheduleTime?: double(name='AvgScheduleTime'),
          avgSsstoreReadRows?: double(name='AvgSsstoreReadRows'),
          avgUsedWorkerCount?: double(name='AvgUsedWorkerCount'),
          avgUserIoWaitTime?: double(name='AvgUserIoWaitTime'),
          avgWaitCount?: double(name='AvgWaitCount'),
          avgWaitTime?: double(name='AvgWaitTime'),
          clientIp?: string(name='ClientIp'),
          cpuPercentage?: double(name='CpuPercentage'),
          dbName?: string(name='DbName'),
          distPlanPercentage?: double(name='DistPlanPercentage'),
          execPs?: double(name='ExecPs'),
          executions?: long(name='Executions'),
          failCount?: double(name='FailCount'),
          failPercentage?: double(name='FailPercentage'),
          inner?: boolean(name='Inner'),
          localPlanPercentage?: double(name='LocalPlanPercentage'),
          maxAffectedRows?: double(name='MaxAffectedRows'),
          maxApplicationWaitTime?: double(name='MaxApplicationWaitTime'),
          maxConcurrencyWaitTime?: double(name='MaxConcurrencyWaitTime'),
          maxCpuTime?: double(name='MaxCpuTime'),
          maxDiskReads?: double(name='MaxDiskReads'),
          maxElapsedTime?: double(name='MaxElapsedTime'),
          maxReturnRows?: double(name='MaxReturnRows'),
          maxUserIoWaitTime?: double(name='MaxUserIoWaitTime'),
          maxWaitTime?: double(name='MaxWaitTime'),
          missPlanPercentage?: double(name='MissPlanPercentage'),
          missPlans?: double(name='MissPlans'),
          remotePlanPercentage?: double(name='RemotePlanPercentage'),
          remotePlans?: double(name='RemotePlans'),
          retCode4012Count?: long(name='RetCode4012Count'),
          retCode4013Count?: long(name='RetCode4013Count'),
          retCode5001Count?: long(name='RetCode5001Count'),
          retCode5024Count?: long(name='RetCode5024Count'),
          retCode5167Count?: long(name='RetCode5167Count'),
          retCode5217Count?: long(name='RetCode5217Count'),
          retCode6002Count?: long(name='RetCode6002Count'),
          retryCount?: double(name='RetryCount'),
          rpcCount?: double(name='RpcCount'),
          server?: string(name='Server'),
          serverIp?: string(name='ServerIp'),
          serverPort?: long(name='ServerPort'),
          sqlId?: string(name='SqlId'),
          sqlTextShort?: string(name='SqlTextShort'),
          sqlType?: string(name='SqlType'),
          strongConsistencyPercentage?: double(name='StrongConsistencyPercentage'),
          sumDbTime?: double(name='SumDbTime'),
          sumElapsedTime?: double(name='SumElapsedTime'),
          sumLogicalReads?: double(name='SumLogicalReads'),
          sumWaitTime?: double(name='SumWaitTime'),
          tableScanPercentage?: double(name='TableScanPercentage'),
          totalWaitTime?: double(name='TotalWaitTime'),
          userName?: string(name='UserName'),
          waitEvent?: string(name='WaitEvent'),
          weakConsistencyPercentage?: double(name='WeakConsistencyPercentage'),
        }
      ](name='SqlList'),
      sqlTextShort?: string(name='SqlTextShort', description='SQL text (the first 100 characters).'),
      sqlType?: string(name='SqlType', description='SQL type.', example='select'),
      strongConsistencyPercentage?: double(name='StrongConsistencyPercentage', description='Strong consistent transaction percentage during the execution period.', example='100.0'),
      sumDbTime?: double(name='SumDbTime'),
      sumElapsedTime?: double(name='SumElapsedTime', description='Total response time (in milliseconds) during the execution period.', example='11452126.36'),
      sumLogicalReads?: double(name='SumLogicalReads', description='Total logical reads.', example='0.0'),
      sumWaitTime?: double(name='SumWaitTime', description='Total wait time (in milliseconds) during the execution period.', example='9421.73'),
      tableScanPercentage?: double(name='TableScanPercentage', description='Table scan percentage during the execution period.', example='0.0'),
      totalWaitTime?: double(name='TotalWaitTime', description='Total wait time (in milliseconds) during the execution period.', example='10.966'),
      userName?: string(name='UserName', description='Username.', example='test_user'),
      waitEvent?: string(name='WaitEvent', description='Longest wait event during the execution period.', example='none'),
      weakConsistencyPercentage?: double(name='WeakConsistencyPercentage', description='Eventually consistent transaction percentage during the execution period.', example='0.0'),
    }
  ](name='Data', description='The list of Top SQL.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeOasTopSQLListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOasTopSQLListResponseBody(name='body'),
}

/**
 * @summary You can call this API to retrieve the list of data on the SQL execution performance collected by the diagnostic system.
 *
 * @param request DescribeOasTopSQLListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOasTopSQLListResponse
 */
async function describeOasTopSQLListWithOptions(request: DescribeOasTopSQLListRequest, runtime: Util.RuntimeOptions): DescribeOasTopSQLListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    body['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.dynamicSql)) {
    body['DynamicSql'] = request.dynamicSql;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.filterCondition)) {
    body['FilterCondition'] = request.filterCondition;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.mergeDynamicSql)) {
    body['MergeDynamicSql'] = request.mergeDynamicSql;
  }
  if (!Util.isUnset(request.nodeIp)) {
    body['NodeIp'] = request.nodeIp;
  }
  if (!Util.isUnset(request.searchKeyWord)) {
    body['SearchKeyWord'] = request.searchKeyWord;
  }
  if (!Util.isUnset(request.searchParam)) {
    body['SearchParam'] = request.searchParam;
  }
  if (!Util.isUnset(request.searchRule)) {
    body['SearchRule'] = request.searchRule;
  }
  if (!Util.isUnset(request.searchValue)) {
    body['SearchValue'] = request.searchValue;
  }
  if (!Util.isUnset(request.sqlId)) {
    body['SqlId'] = request.sqlId;
  }
  if (!Util.isUnset(request.sqlTextLength)) {
    body['SqlTextLength'] = request.sqlTextLength;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOasTopSQLList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this API to retrieve the list of data on the SQL execution performance collected by the diagnostic system.
 *
 * @param request DescribeOasTopSQLListRequest
 * @return DescribeOasTopSQLListResponse
 */
async function describeOasTopSQLList(request: DescribeOasTopSQLListRequest): DescribeOasTopSQLListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOasTopSQLListWithOptions(request, runtime);
}

model DescribeOutlineBindingRequest {
  databaseName?: string(name='DatabaseName', description='The name of the database.

This parameter is required.', example='testdb'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
  isConcurrentLimit?: boolean(name='IsConcurrentLimit', description='- When the value is set to True, the throttling information in the database is queried based on the SQL ID.   
- When the value is set to False, the bound index or execution plan in the database is queried based on the SQL ID.', example='false'),
  SQLId?: string(name='SQLId', description='SQLID.

This parameter is required.', example='8D6E84****0B8FB1823D199E2CA1****'),
  tableName?: string(name='TableName', description='The name of the tenant.    
It must start with a letter or an underscore (_), and contain 2 to 20 characters, which can be uppercase letters, lowercase letters, digits, and underscores (_). It cannot be set to SYS.

This parameter is required.', example='pay_online'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeOutlineBindingResponseBody = {
  outlineBinding?: {
    bindIndex?: string(name='BindIndex', description='The bound index.', example='PRIMARY'),
    bindPlan?: string(name='BindPlan', description='The bound plan.', example='PHY_TABLE_SCAN | bmsql_order_line | 40 ******'),
    maxConcurrent?: int32(name='MaxConcurrent', description='The maximum number of concurrent tasks.', example='2'),
    outlineId?: long(name='OutlineId', description='OutlineID.', example='-1'),
    tableName?: string(name='TableName', description='The name of the tenant. The tenant name must start with a letter or an underscore (_), and contain 2 to 20 characters, which can be uppercase letters, lowercase letters, digits, and underscores (_). It cannot be set to sys.', example='cluster_info'),
  }(name='OutlineBinding', description='The binding information.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeOutlineBindingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOutlineBindingResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the outline binding information or throttling information of an SQL statement in the database based on an SQLID.
 *
 * @param request DescribeOutlineBindingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOutlineBindingResponse
 */
async function describeOutlineBindingWithOptions(request: DescribeOutlineBindingRequest, runtime: Util.RuntimeOptions): DescribeOutlineBindingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.databaseName)) {
    body['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.isConcurrentLimit)) {
    body['IsConcurrentLimit'] = request.isConcurrentLimit;
  }
  if (!Util.isUnset(request.SQLId)) {
    body['SQLId'] = request.SQLId;
  }
  if (!Util.isUnset(request.tableName)) {
    body['TableName'] = request.tableName;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOutlineBinding',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the outline binding information or throttling information of an SQL statement in the database based on an SQLID.
 *
 * @param request DescribeOutlineBindingRequest
 * @return DescribeOutlineBindingResponse
 */
async function describeOutlineBinding(request: DescribeOutlineBindingRequest): DescribeOutlineBindingResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOutlineBindingWithOptions(request, runtime);
}

model DescribeParametersRequest {
  dimension?: string(name='Dimension', description='It is an online CLI tool that allows you to quickly retrieve and debug APIs. It can dynamically generate executable SDK code samples.

This parameter is required.', example='TENANT'),
  dimensionValue?: string(name='DimensionValue', description='Alibaba Cloud CLI', example='ob2mr3oae0****'),
  instanceId?: string(name='InstanceId', description='498529

This parameter is required.', example='ob317v4uif****'),
}

model DescribeParametersResponseBody = {
  parameters?: [ 
    {
      acceptableValue?: [ string ](name='AcceptableValue', description='DescribeParameters'),
      currentValue?: string(name='CurrentValue', description='The ID of the OceanBase cluster.', example='600'),
      defaultValue?: string(name='DefaultValue', description='```
http(s)://[Endpoint]/?Action=DescribeParameters
&InstanceId=ob317v4uif****
&Dimension=TENANT
&DimensionValue=ob2mr3oae0****
&Common request parameters
```', example='600s'),
      description?: string(name='Description', description='The description of the parameter.', example='The operation that you want to perform.   
Set the value to **DescribeParameters**.'),
      name?: string(name='Name', description='The request ID.', example='connect_timeout'),
      needReboot?: boolean(name='NeedReboot', description='The name of the parameter.', example='false'),
      readonly?: boolean(name='Readonly', description='参数是否只读'),
      rejectedValue?: [ string ](name='RejectedValue', description='{
    "RequestId": "EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C",
    "Parameters": [
        {
            "Description": "The maximum delay allowed in weak-consistency reads.",
            "ValueType": "CAPACITY",
            "CurrentValue": "600",
            "NeedReboot": false,
            "Name": "connect_timeout",
            "DefaultValue": "600s",
            "RejectedValue": [
                "1s"
            ],
            "AcceptableValue": [
                "1s"
            ]
        }
    ]
}'),
      unit?: string(name='Unit', example='s'),
      valueType?: string(name='ValueType', description='The invalid value range of the parameter.    
It is an array with two string elements, which represents a range. The first element represents the minimum value and the second element represents the maximum value.', example='CAPACITY'),
    }
  ](name='Parameters', description='Indicates whether a restart is required for changes to the parameter to take effect. Valid values:   
- true: A restart is required.   
- false: A restart is not required.'),
  requestId?: string(name='RequestId', description='The return result of the request.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParametersResponseBody(name='body'),
}

/**
 * @summary Indicates whether a restart is required for changes to the parameter to take effect. Valid values: - true: A restart is required. - false: A restart is not required.
 *
 * @param request DescribeParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParametersResponse
 */
async function describeParametersWithOptions(request: DescribeParametersRequest, runtime: Util.RuntimeOptions): DescribeParametersResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dimension)) {
    body['Dimension'] = request.dimension;
  }
  if (!Util.isUnset(request.dimensionValue)) {
    body['DimensionValue'] = request.dimensionValue;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeParameters',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Indicates whether a restart is required for changes to the parameter to take effect. Valid values: - true: A restart is required. - false: A restart is not required.
 *
 * @param request DescribeParametersRequest
 * @return DescribeParametersResponse
 */
async function describeParameters(request: DescribeParametersRequest): DescribeParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeParametersWithOptions(request, runtime);
}

model DescribeParametersHistoryRequest {
  dimension?: string(name='Dimension', description='The type of the parameter.    
Valid values: CLUSTER and TENANT.

This parameter is required.', example='TENANT'),
  dimensionValue?: string(name='DimensionValue', description='The resource ID of the parameter type.   
You can leave this parameter unspecified when you call this operation to query cluster parameters. In the case of tenant parameters, pass the tenant ID.', example='t4qx8****'),
  endTime?: string(name='EndTime', description='The end time of the time range for querying the SQL execution history.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-09-13 15:40:43'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.    
- Start value: 1   
- Default value: 1

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of rows to return on each page.   
- Maximum value: 100.
- Default value: 10

This parameter is required.', example='10'),
  startTime?: string(name='StartTime', description='The start time of querying the slow query execution.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-06-13 15:40:43'),
}

model DescribeParametersHistoryResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  respond?: {
    pageNumber?: int32(name='PageNumber', description='The number of the page to return.    
- Start value: 1   
- Default value: 1', example='1'),
    parameters?: [ 
      {
        createTime?: string(name='CreateTime', description='The time when the parameter modification was initiated.', example='2024-11-26T08:03:34Z'),
        dimensionValue?: string(name='DimensionValue', description='The resource ID of the parameter type. When you called this operation to query the modification history of cluster parameters, the value is DEFAULT_DIMENSION_VALUE. When you called this operation to query the modification history of tenant parameters, the value is the tenant ID.', example='t69uo********'),
        name?: string(name='Name', description='The name of the parameter.', example='connect_timeout'),
        newValue?: string(name='NewValue', description='The value of the parameter after the modification.', example='30'),
        oldValue?: string(name='OldValue', description='The value of the parameter before the modification.', example='10'),
        status?: string(name='Status', description='The modification status of the parameter. Valid values: 
* APPLIED: The parameter was modified.
* SCHEDULING: The parameter was to be modified.', example='APPLIED'),
        updateTime?: string(name='UpdateTime', description='The time when the parameter modification took effect.', example='2024-11-26T08:03:34Z'),
      }
    ](name='Parameters', description='The information about parameters.'),
    totalCount?: int32(name='TotalCount', description='The total count, which takes effect in a pagination query.', example='5'),
  }(name='Respond', description='The list of parameter modification records.'),
}

model DescribeParametersHistoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParametersHistoryResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the modification history of cluster or tenant parameters.
 *
 * @param request DescribeParametersHistoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParametersHistoryResponse
 */
async function describeParametersHistoryWithOptions(request: DescribeParametersHistoryRequest, runtime: Util.RuntimeOptions): DescribeParametersHistoryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dimension)) {
    body['Dimension'] = request.dimension;
  }
  if (!Util.isUnset(request.dimensionValue)) {
    body['DimensionValue'] = request.dimensionValue;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeParametersHistory',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the modification history of cluster or tenant parameters.
 *
 * @param request DescribeParametersHistoryRequest
 * @return DescribeParametersHistoryResponse
 */
async function describeParametersHistory(request: DescribeParametersHistoryRequest): DescribeParametersHistoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeParametersHistoryWithOptions(request, runtime);
}

model DescribeProcessStatsCompositionRequest {
  clientIp?: string(name='ClientIp', description='The IP address of the client.', example='127.*.*.*'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  serverIp?: string(name='ServerIp', description='The IP address of the server.', example='127.*.*.*'),
  sqlText?: string(name='SqlText', description='The SQL statement, which can contain LIKE clauses. You can specify only part of the clauses in the SQL statement.', example='SELECT  ****   FROM ****   WHERE **** = ? AND **** = ?   ORDER BY **** ASC'),
  status?: string(name='Status', description='The status of the session.', example='ACTIVE'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t33h8y08k****'),
  UId?: string(name='UId', description='The user identifier (UID) of the OceanBase database.', example='139*************'),
  users?: string(name='Users', description='The username of the database.', example='["test_user"]'),
}

model DescribeProcessStatsCompositionResponseBody = {
  data?: {
    activeSessionCount?: int32(name='ActiveSessionCount', description='The number of active sessions.', example='60'),
    allProcessList?: [ 
      {
        clientIp?: string(name='ClientIp', description='The IP address of the client.', example='xx.xx.xx.xx'),
        command?: string(name='Command', description='The type of the SQL statement being executed in the session.', example='Query'),
        cpuTime?: long(name='CpuTime', description='The CPU time spent on executing the current SQL statement, in seconds. 

> This parameter is introduced since OceanBase Database V3.2.4 BP5.', example='1'),
        database?: string(name='Database', description='The name of the database.', example='c1'),
        executeTime?: long(name='ExecuteTime', description='The definition of this parameter varies based on whether the SQL statement is executed.
* When the request is accepted and the result is not returned to the client, this parameter indicates the time interval between the time when the request is accepted and the current time, in seconds.
* When the request is not accepted, this parameter indicates the duration for which the current status lasts, in seconds.', example='5'),
        planId?: string(name='PlanId', description='The ID of the execution plan.', example='1898'),
        proxySessId?: string(name='ProxySessId', description='The session ID of the client. If an OceanBase Database Proxy (ODP) is used for connection, the session ID of the ODP is returned.', example='7521015416********'),
        serverIp?: string(name='ServerIp', description='The IP address of the server.', example='xx.xx.xx.xx'),
        sessionId?: long(name='SessionId', description='The ID of the session.', example='322441****'),
        sqlId?: string(name='SqlId', description='The ID of the SQL statement.', example='45CCBDC7DEBDCDAXXXXAFC********'),
        sqlText?: string(name='SqlText', description='The SQL text.', example='select * from c1 where id = 100;'),
        status?: string(name='Status', description='The status of the session.', example='ACTIVE'),
        tenantId?: string(name='TenantId', description='The ID of the tenant.', example='test_mysql'),
        traceId?: string(name='TraceId', description='The ID of the trace.', example='YB420XXX128-00062XXXX8313XXX1-X-X'),
        user?: string(name='User', description='The user to which the session belongs.', example='test_user'),
      }
    ](name='AllProcessList', description='The details of all sessions.'),
    idleSessionCount?: int32(name='IdleSessionCount', description='The number of sessions in the SLEEP state.', example='30'),
    obVersion?: string(name='ObVersion', description='The version of OceanBase Database.', example='3.2.4'),
    sessionStatistics?: {
      dataBaseStatistics?: [ 
        {
          activeCount?: long(name='ActiveCount', description='The number of active sessions.', example='25'),
          metricValue?: string(name='MetricValue', description='The name of the database.', example='test_database'),
          totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='30'),
          type?: string(name='Type', description='The dimension. This value is fixed to database.', example='database'),
        }
      ](name='DataBaseStatistics', description='The session data in the database dimension.'),
      sourceStatistics?: [ 
        {
          activeCount?: long(name='ActiveCount', description='The number of active sessions.', example='25'),
          metricValue?: string(name='MetricValue', description='The IP address of the client.', example='xx.xx.xx.xx'),
          totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='30'),
          type?: string(name='Type', description='The dimension. This value is fixed to client.', example='client'),
        }
      ](name='SourceStatistics', description='The session data in the client dimension.'),
      userStatistics?: [ 
        {
          activeCount?: long(name='ActiveCount', description='The number of active sessions.', example='25'),
          metricValue?: string(name='MetricValue', description='The username.', example='test_user'),
          totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='30'),
          type?: string(name='Type', description='The dimension. This value is fixed to user.', example='user'),
        }
      ](name='UserStatistics', description='The session data in the user dimension.'),
    }(name='SessionStatistics', description='The session data in different dimensions.'),
    totalSessionCount?: int32(name='TotalSessionCount', description='The total number of sessions.', example='100'),
  }(name='Data', description='The return result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeProcessStatsCompositionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProcessStatsCompositionResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query session information.
 *
 * @param request DescribeProcessStatsCompositionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProcessStatsCompositionResponse
 */
async function describeProcessStatsCompositionWithOptions(request: DescribeProcessStatsCompositionRequest, runtime: Util.RuntimeOptions): DescribeProcessStatsCompositionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientIp)) {
    body['ClientIp'] = request.clientIp;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.serverIp)) {
    body['ServerIp'] = request.serverIp;
  }
  if (!Util.isUnset(request.sqlText)) {
    body['SqlText'] = request.sqlText;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.UId)) {
    body['UId'] = request.UId;
  }
  if (!Util.isUnset(request.users)) {
    body['Users'] = request.users;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeProcessStatsComposition',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query session information.
 *
 * @param request DescribeProcessStatsCompositionRequest
 * @return DescribeProcessStatsCompositionResponse
 */
async function describeProcessStatsComposition(request: DescribeProcessStatsCompositionRequest): DescribeProcessStatsCompositionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProcessStatsCompositionWithOptions(request, runtime);
}

model DescribeProjectRequest {
  id?: string(name='Id', description='This parameter is required.', example='np_fe****'),
}

model DescribeProjectResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: {
    alarmStats?: {
      alarmContent?: string(name='AlarmContent', example='null'),
      alarming?: boolean(name='Alarming', example='false'),
      openMonitor?: boolean(name='OpenMonitor', example='true'),
      recentlyTriggerCount?: int32(name='RecentlyTriggerCount', example='0'),
      ruleToRecentlyTriggerCount?: map[string]int32(name='RuleToRecentlyTriggerCount'),
      target?: string(name='Target', example='null'),
    }(name='AlarmStats'),
    commonTransferConfig?: {
      activeActive?: boolean(name='ActiveActive', example='true'),
      dataWorksBusinessName?: string(name='DataWorksBusinessName', example='null'),
      datahubTopicType?: string(name='DatahubTopicType', example='TUPLE'),
      mqPartition?: int32(name='MqPartition', example='0'),
      mqPartitionMode?: string(name='MqPartitionMode', example='ONE'),
      mqSerializerType?: string(name='MqSerializerType', example='DEFAULT'),
      rocketMqEnableMsgTrace?: boolean(name='RocketMqEnableMsgTrace', example='true'),
      rocketMqMsgTags?: string(name='RocketMqMsgTags', example='default_tag'),
      rocketMqProducerGroup?: string(name='RocketMqProducerGroup', example='OMS'),
      rocketMqSendMsgTimeout?: long(name='RocketMqSendMsgTimeout', example='null'),
      sinkStoreFormat?: string(name='SinkStoreFormat'),
      sourceStoreFormat?: string(name='SourceStoreFormat'),
      tableCategory?: string(name='TableCategory', example='ALL'),
    }(name='CommonTransferConfig'),
    destConnId?: string(name='DestConnId', example='c_deg***'),
    enableFullTransfer?: boolean(name='EnableFullTransfer', example='true'),
    enableFullVerify?: boolean(name='EnableFullVerify', example='true'),
    enableIncrTransfer?: boolean(name='EnableIncrTransfer', example='true'),
    enableIncrVerify?: boolean(name='EnableIncrVerify', example='true'),
    enableReverseIncrTransfer?: boolean(name='EnableReverseIncrTransfer', example='true'),
    enableStructTransfer?: boolean(name='EnableStructTransfer', example='true'),
    extraInfo?: {
      accessObSource?: boolean(name='AccessObSource', example='true'),
      ignoreUnsupportDdl?: boolean(name='IgnoreUnsupportDdl', example='false'),
      incrSyncTimestamp?: long(name='IncrSyncTimestamp', example='1689244596'),
      logServiceStartCheckpoint?: long(name='LogServiceStartCheckpoint', example='1689214358'),
      maxConnectorCount?: int32(name='MaxConnectorCount', example='-1'),
      monitoringIncr?: boolean(name='MonitoringIncr', example='true'),
      overwriteConfig?: boolean(name='OverwriteConfig', example='true'),
      reverseSubtopics?: [ string ](name='ReverseSubtopics'),
      runningProgress?: int32(name='RunningProgress', example='90'),
      runningStep?: string(name='RunningStep', example='PRE-CHECK'),
      sourceStoreKeptHour?: int32(name='SourceStoreKeptHour', example='24'),
      storeIncr?: boolean(name='StoreIncr', example='true'),
      subConds?: map[string][ DataExtraInfoSubCondsValue       ](name='SubConds'),
      subDbs?: map[string][ DataExtraInfoSubDbsValue       ](name='SubDbs'),
      subIds?: map[string]string(name='SubIds'),
      subtopics?: [ string ](name='Subtopics'),
      syncDelay?: long(name='SyncDelay', example='null'),
      syncDelaySampleTimestamp?: long(name='SyncDelaySampleTimestamp', example='1689214358'),
    }(name='ExtraInfo'),
    fullTransferConfig?: {
      allowDestTableNotEmpty?: boolean(name='AllowDestTableNotEmpty', example='true'),
      fullTransferSpeedMode?: string(name='FullTransferSpeedMode', example='FAST'),
      fullVerifySpeedMode?: string(name='FullVerifySpeedMode', example='FAST'),
      nonePkUkTruncateDstTable?: boolean(name='NonePkUkTruncateDstTable', example='false'),
      readWorkerNum?: int32(name='ReadWorkerNum'),
      throttleIOPS?: int32(name='ThrottleIOPS'),
      throttleRps?: int32(name='ThrottleRps'),
      writeWorkerNum?: int32(name='WriteWorkerNum'),
    }(name='FullTransferConfig'),
    gmtCreate?: string(name='GmtCreate', example='2023-07-13T06:26:15'),
    gmtFinish?: string(name='GmtFinish', example='2023-07-13T07:02:27'),
    gmtModified?: string(name='GmtModified', example='2023-07-13T06:26:15'),
    gmtStart?: string(name='GmtStart', example='2023-07-13T07:02:27'),
    id?: string(name='Id', example='np_fe****'),
    importance?: string(name='Importance', example='HIGH'),
    incrTransferConfig?: {
      enableIncrSyncStatistics?: boolean(name='EnableIncrSyncStatistics', example='true'),
      enableSequencingWithinTxn?: boolean(name='EnableSequencingWithinTxn', example='false'),
      incrSyncConcurrency?: int32(name='IncrSyncConcurrency', example='64'),
      recordTypeWhiteList?: [ string ](name='RecordTypeWhiteList'),
      startTimestamp?: long(name='StartTimestamp', example='1667286900'),
      storeLogKeptHour?: int32(name='StoreLogKeptHour', example='24'),
      supportDDLTypes?: [ string ](name='SupportDDLTypes'),
      throttleIOPS?: int32(name='ThrottleIOPS'),
      throttleRps?: int32(name='ThrottleRps'),
    }(name='IncrTransferConfig'),
    isMerging?: boolean(name='IsMerging', example='false'),
    isModifying?: boolean(name='IsModifying', example='false'),
    isSubProject?: boolean(name='IsSubProject', example='false'),
    labels?: [ 
      {
        id?: string(name='Id', example='l_dr****'),
        name?: string(name='Name', example='test_tag'),
      }
    ](name='Labels'),
    name?: string(name='Name', example='test'),
    owner?: string(name='Owner', example='omsefry***'),
    reverseIncrTransferConfig?: {
      enableIncrSyncStatistics?: boolean(name='EnableIncrSyncStatistics'),
      enableSequencingWithinTxn?: boolean(name='EnableSequencingWithinTxn'),
      incrSyncConcurrency?: int32(name='IncrSyncConcurrency'),
      recordTypeWhiteList?: [ string ](name='RecordTypeWhiteList'),
      startTimestamp?: long(name='StartTimestamp'),
      storeLogKeptHour?: int32(name='StoreLogKeptHour'),
      supportDDLTypes?: [ string ](name='SupportDDLTypes'),
      throttleIOPS?: int32(name='ThrottleIOPS'),
      throttleRps?: int32(name='ThrottleRps'),
    }(name='ReverseIncrTransferConfig'),
    sinkConnectInfo?: {
      charset?: string(name='Charset', example='utf8mb4'),
      connExtraAttributes?: any(name='ConnExtraAttributes', example='null'),
      connectionInfo?: string(name='ConnectionInfo', example='null'),
      dbEngine?: string(name='DbEngine', example='MYSQL_PUBLIC'),
      endpointId?: string(name='EndpointId', example='e_4w1q****'),
      endpointName?: string(name='EndpointName', example='RATION12948*****'),
      endpointSide?: string(name='EndpointSide', example='sink'),
      host?: string(name='Host', example='xxx.xxx.xxx.1'),
      id?: string(name='Id', example='e_4lgzuzi9znr4'),
      nlsLengthSemantics?: string(name='NlsLengthSemantics', example='null'),
      ocpName?: string(name='OcpName', example='null'),
      operatingSystem?: string(name='OperatingSystem', example='Linux'),
      owner?: string(name='Owner', description='Owner。', example='oms_test'),
      port?: int32(name='Port', example='2883'),
      region?: string(name='Region', example='cn-hangzhou'),
      resourceOwner?: string(name='ResourceOwner', example='1325847***'),
      timezone?: string(name='Timezone', example='+08:00'),
      username?: string(name='Username', example='oms2027obmysql@oms_***'),
      version?: string(name='Version', example='2.2.77'),
    }(name='SinkConnectInfo'),
    sinkEndpointType?: string(name='SinkEndpointType', example='MYSQL'),
    sourceConnectInfo?: {
      charset?: string(name='Charset', example='utf8mb4'),
      connExtraAttributes?: any(name='ConnExtraAttributes', example='null'),
      connectionInfo?: string(name='ConnectionInfo', example='null'),
      dbEngine?: string(name='DbEngine', example='OB_MYSQL_PUBLIC'),
      endpointId?: string(name='EndpointId', example='e_3kx5i***1s'),
      endpointName?: string(name='EndpointName', example='migon****'),
      endpointSide?: string(name='EndpointSide', example='source'),
      host?: string(name='Host', example='xxx.xxx.xxx.1'),
      id?: string(name='Id', example='c_feg****'),
      nlsLengthSemantics?: string(name='NlsLengthSemantics', example='null'),
      ocpName?: string(name='OcpName', example='null'),
      operatingSystem?: string(name='OperatingSystem', example='Linux'),
      owner?: string(name='Owner', description='Owner。', example='oms_test'),
      port?: int32(name='Port', example='2883'),
      region?: string(name='Region', example='cn-shanghai'),
      resourceOwner?: string(name='ResourceOwner', example='1325847***'),
      timezone?: string(name='Timezone', example='+08:00'),
      username?: string(name='Username', example='oms2027obmysql@oms_***'),
      version?: string(name='Version', example='2.2.77'),
    }(name='SourceConnectInfo'),
    sourceEndpointType?: string(name='SourceEndpointType', example='OB_MYSQL'),
    status?: string(name='Status', example='RUNNING'),
    steps?: [ 
      {
        description?: string(name='Description'),
        extraInfo?: {
          errorCode?: string(name='ErrorCode', example='INNER_ERROR'),
          errorDetails?: [ 
            {
              code?: string(name='Code', example='CM-RESOAT1111'),
              extraContext?: map[string]any(name='ExtraContext'),
              level?: string(name='Level', description='FATAL, ERROR, WARNING, CRITICAL', example='ERROR'),
              message?: string(name='Message', example='A system error occurred.'),
              messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
              messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
              proposal?: string(name='Proposal', example='Contact the administrator.'),
              proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
              proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
              reason?: string(name='Reason', example='null'),
              reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
              reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
              upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
            }
          ](name='ErrorDetails'),
          errorMsg?: string(name='ErrorMsg', example='A system error occurred.'),
          errorParam?: map[string]string(name='ErrorParam'),
          failedTime?: string(name='FailedTime', example='null'),
        }(name='ExtraInfo'),
        finishTime?: string(name='FinishTime', example='2020-05-22T17:04:18'),
        name?: string(name='Name', example='PRE_CHECK'),
        order?: int32(name='Order', example='1'),
        progress?: int32(name='Progress', example='90'),
        startTime?: string(name='StartTime', example='2020-05-22T17:04:18'),
        status?: string(name='Status', example='RUNNING'),
        stepInfo?: map[string]any(name='StepInfo'),
      }
    ](name='Steps'),
    structTransferConfig?: {
      byteCharConvertStrategy?: string(name='ByteCharConvertStrategy', example='DO_NOTHING_IF_BYTE_USED'),
      deferIndexCreation?: boolean(name='DeferIndexCreation', example='true'),
    }(name='StructTransferConfig'),
    transferMapping?: {
      databases?: [ 
        {
          id?: string(name='Id', example='db_id'),
          mappedName?: string(name='MappedName', example='mapped_db'),
          name?: string(name='Name', example='db_name'),
          specificTables?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='table_id'),
              mappedName?: string(name='MappedName', example='mapped_table'),
              name?: string(name='Name', example='table_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id>1'),
            }
          ](name='SpecificTables'),
          specificViews?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='view_id'),
              mappedName?: string(name='MappedName', example='mapped_name'),
              name?: string(name='Name', example='view_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id<3'),
            }
          ](name='SpecificViews'),
          tables?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='table_id'),
              mappedName?: string(name='MappedName', example='mapped_table'),
              name?: string(name='Name', example='table_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id > 1'),
            }
          ](name='Tables'),
          tenantName?: string(name='TenantName', example='tenant_name'),
          type?: string(name='Type', example='MYSQL'),
          views?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='fexdg***'),
              mappedName?: string(name='MappedName', example='mapped_view'),
              name?: string(name='Name', example='view_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id < 1'),
            }
          ](name='Views'),
        }
      ](name='Databases'),
      databasesBlack?: [ 
        {
          id?: string(name='Id', example='db_id'),
          mappedName?: string(name='MappedName', example='mapped_db'),
          name?: string(name='Name', example='db_name'),
          specificTables?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='table_id'),
              mappedName?: string(name='MappedName', example='mapped_table'),
              name?: string(name='Name', example='table_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id<3'),
            }
          ](name='SpecificTables'),
          specificViews?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='view_id'),
              mappedName?: string(name='MappedName', example='mapped_view'),
              name?: string(name='Name', example='view_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id>2'),
            }
          ](name='SpecificViews'),
          tables?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='table_id'),
              mappedName?: string(name='MappedName', example='mapped_table'),
              name?: string(name='Name', example='table_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id>1'),
            }
          ](name='Tables'),
          tenantName?: string(name='TenantName', example='mapped_tenant'),
          type?: string(name='Type', example='DATABASE'),
          views?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: string(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='view_id'),
              mappedName?: string(name='MappedName', example='mapped_name'),
              name?: string(name='Name', example='view_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id>2'),
            }
          ](name='Views'),
        }
      ](name='DatabasesBlack'),
      mode?: string(name='Mode', example='SPECIFIC'),
      tableAndViewBlackList?: [ string ](name='TableAndViewBlackList'),
      tableAndViewWhiteList?: [ string ](name='TableAndViewWhiteList'),
    }(name='TransferMapping'),
    type?: string(name='Type', example='SYNC'),
    workerGradeId?: string(name='WorkerGradeId', example='g_i4wa7XXX'),
    workerGradeInfo?: {
      autoRenewal?: boolean(name='AutoRenewal'),
      chargeType?: string(name='ChargeType'),
      destRegion?: string(name='DestRegion'),
      destType?: string(name='DestType'),
      endTime?: string(name='EndTime'),
      expired?: boolean(name='Expired'),
      gmtCreate?: string(name='GmtCreate'),
      grade?: string(name='Grade'),
      id?: string(name='Id'),
      name?: string(name='Name'),
      sourceRegion?: string(name='SourceRegion'),
      sourceType?: string(name='SourceType'),
      spec?: string(name='Spec'),
      specName?: string(name='SpecName'),
    }(name='WorkerGradeInfo'),
  }(name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='473469C7-XXXX-XXXX-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='2'),
}

model DescribeProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectResponseBody(name='body'),
}

/**
 * @summary 查询项目详情
 *
 * @param request DescribeProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectResponse
 */
async function describeProjectWithOptions(request: DescribeProjectRequest, runtime: Util.RuntimeOptions): DescribeProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeProject',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询项目详情
 *
 * @param request DescribeProjectRequest
 * @return DescribeProjectResponse
 */
async function describeProject(request: DescribeProjectRequest): DescribeProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProjectWithOptions(request, runtime);
}

model DescribeProjectComponentsRequest {
  id?: string(name='Id', description='This parameter is required.', example='np_4w3a****'),
}

model DescribeProjectComponentsResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='48'),
  data?: {
    fullImportComponents?: [ 
      {
        errorDetails?: [ 
          {
            code?: string(name='Code', example='CM-RESOAT1111'),
            extraContext?: map[string]any(name='ExtraContext'),
            level?: string(name='Level', example='ERROR'),
            message?: string(name='Message', example='A system error occurred.'),
            messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
            messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
            proposal?: string(name='Proposal', example='null'),
            proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
            proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
            reason?: string(name='Reason', example='null'),
            reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
            reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
            upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
          }
        ](name='ErrorDetails'),
        gmtCreate?: string(name='GmtCreate', example='2023-07-13T18:04:36'),
        gmtModify?: string(name='GmtModify', example='2023-07-13T18:04:36'),
        identity?: string(name='Identity', example='p_4w8v****'),
        ip?: string(name='Ip', example='xxx.xxx.xxx.1'),
        name?: string(name='Name', example='xxx.xxx.xxx.1-9000:connector_v2:np_4w8v****c-full_trans-1-0:0000000276'),
        progress?: int32(name='Progress', example='90'),
        region?: string(name='Region', example='cn-hangzhou'),
        status?: string(name='Status', example='RUNNING'),
      }
    ](name='FullImportComponents'),
    fullVerifyComponents?: [ 
      {
        consistentQuantity?: long(name='ConsistentQuantity', example='100'),
        errorDetails?: [ 
          {
            code?: string(name='Code', example='CM-RESOAT1111'),
            extraContext?: map[string]any(name='ExtraContext'),
            level?: string(name='Level', example='ERROR'),
            message?: string(name='Message', example='A system error occurred.'),
            messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
            messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
            proposal?: string(name='Proposal', example='null'),
            proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
            proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
            reason?: string(name='Reason', example='null'),
            reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
            reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
            upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
          }
        ](name='ErrorDetails'),
        inconsistentQuantity?: long(name='InconsistentQuantity', example='0'),
        ip?: string(name='Ip', example='xxx.xxx.xxx.1'),
        name?: string(name='Name', example='xxx.xxx.xxx.1-9000:90247:0000000033'),
        progress?: string(name='Progress', example='100'),
        recordProgress?: int32(name='RecordProgress', example='100'),
        region?: string(name='Region', example='cn-beijing'),
        status?: string(name='Status', example='RUNNING'),
        taskId?: long(name='TaskId', example='1345***'),
      }
    ](name='FullVerifyComponents'),
    incrSyncComponents?: [ 
      {
        checkpoint?: string(name='Checkpoint', example='2023-07-13T09:19:53'),
        checkpointSampleTimestamp?: long(name='CheckpointSampleTimestamp', example='1689250071'),
        delay?: long(name='Delay', example='1'),
        errorDetails?: [ 
          {
            code?: string(name='Code', example='CM-RESOAT1111'),
            extraContext?: map[string]any(name='ExtraContext'),
            level?: string(name='Level', example='ERROR'),
            message?: string(name='Message', example='A system error occurred.'),
            messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
            messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
            proposal?: string(name='Proposal', example='null'),
            proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
            proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
            reason?: string(name='Reason', example='null'),
            reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
            reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
            upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
          }
        ](name='ErrorDetails'),
        gmtCreate?: string(name='GmtCreate', example='2023-07-13T18:04:36'),
        gmtModify?: string(name='GmtModify', example='2023-07-13T18:04:36'),
        identity?: string(name='Identity', example='np_4w***'),
        ip?: string(name='Ip', example='xxx.xxx.xxx.1'),
        name?: string(name='Name', example='xxx.xxx.xxx.1-9000:connector_v2:np_4w****jxc-incr_trans-1-0:0000000277'),
        region?: string(name='Region', example='cn-zhangjiakou'),
        status?: string(name='Status', example='RUNNING'),
        subtopics?: [ string ](name='Subtopics'),
        tps?: long(name='Tps', example='1'),
      }
    ](name='IncrSyncComponents'),
    reverseIncrSyncComponents?: [ 
      {
        checkpoint?: string(name='Checkpoint', example='2023-07-13T09:19:53'),
        checkpointSampleTimestamp?: long(name='CheckpointSampleTimestamp', example='1689250049'),
        delay?: long(name='Delay', example='1'),
        errorDetails?: [ 
          {
            code?: string(name='Code', example='CM-RESOAT1111'),
            extraContext?: map[string]any(name='ExtraContext'),
            level?: string(name='Level', example='ERROR'),
            message?: string(name='Message', example='A system error occurred.'),
            messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
            messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
            proposal?: string(name='Proposal', example='null'),
            proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
            proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
            reason?: string(name='Reason', example='null'),
            reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
            reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
            upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
          }
        ](name='ErrorDetails'),
        gmtCreate?: string(name='GmtCreate', example='2023-07-13T18:04:36'),
        gmtModify?: string(name='GmtModify', example='2023-07-13T18:04:36'),
        identity?: string(name='Identity', example='np_4w8****'),
        ip?: string(name='Ip', example='xxx.xxx.xxx.1'),
        name?: string(name='Name', example='xxx.xxx.xxx.1-9000:connector_v2:np_4w8****9jxc-incr_trans-1-0:0000000277'),
        region?: string(name='Region', example='cn-shanghai'),
        status?: string(name='Status', example='RUNNING'),
        subtopics?: [ string ](name='Subtopics'),
        tps?: long(name='Tps', example='1'),
      }
    ](name='ReverseIncrSyncComponents'),
    reverseStoreList?: [ 
      {
        beginCheckpoint?: string(name='BeginCheckpoint', example='2023-07-13T09:19:53'),
        conn?: long(name='Conn', example='1'),
        delay?: long(name='Delay', example='1'),
        endCheckpoint?: string(name='EndCheckpoint', example='2023-07-13T09:19:53'),
        errMsg?: string(name='ErrMsg', example='null'),
        errorDetails?: [ 
          {
            code?: string(name='Code', example='CM-RESOAT1111'),
            extraContext?: map[string]any(name='ExtraContext'),
            level?: string(name='Level', example='ERROR'),
            message?: string(name='Message', example='A system error occurred.'),
            messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
            messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
            proposal?: string(name='Proposal', example='null'),
            proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
            proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
            reason?: string(name='Reason', example='null'),
            reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
            reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
            upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
          }
        ](name='ErrorDetails'),
        gmt?: long(name='Gmt', example='1689250071'),
        gmtCreate?: string(name='GmtCreate', example='2023-07-13T18:04:36'),
        gmtModified?: string(name='GmtModified', example='2023-07-13T18:04:36'),
        ip?: string(name='Ip', example='xxx.xxx.xxx.1'),
        latelyHeartbeatTimeSec?: long(name='LatelyHeartbeatTimeSec', example='1689250071'),
        name?: string(name='Name', example='xxx.xxx.xxx.1-9000:connector_v2:np_4w****9jxc-incr_trans-1-0:0000000277'),
        port?: int32(name='Port', example='2883'),
        region?: string(name='Region', example='cn-shenzhen'),
        status?: string(name='Status', example='EXCEPTION'),
        storePort?: int32(name='StorePort', example='2882'),
        subtopic?: string(name='Subtopic', description='SubTopic。', example='null'),
        toSwitch?: boolean(name='ToSwitch', example='false'),
        topic?: string(name='Topic', description='Topic。', example='null'),
        tps?: long(name='Tps', example='1'),
      }
    ](name='ReverseStoreList'),
    storeList?: [ 
      {
        beginCheckpoint?: string(name='BeginCheckpoint', example='2023-07-13T09:19:53'),
        conn?: long(name='Conn', example='1'),
        delay?: long(name='Delay', example='24'),
        endCheckpoint?: string(name='EndCheckpoint', example='2023-07-13T09:19:53'),
        errMsg?: string(name='ErrMsg', example='null'),
        errorDetails?: [ 
          {
            code?: string(name='Code', example='CM-RESOAT1111'),
            extraContext?: map[string]any(name='ExtraContext'),
            level?: string(name='Level', example='ERROR'),
            message?: string(name='Message', example='A system error occurred.'),
            messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
            messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
            proposal?: string(name='Proposal', example='null'),
            proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
            proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
            reason?: string(name='Reason', example='null'),
            reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
            reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
            upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
          }
        ](name='ErrorDetails'),
        gmt?: long(name='Gmt', example='1689250049'),
        gmtCreate?: string(name='GmtCreate', example='2023-07-13T17:29:54'),
        gmtModified?: string(name='GmtModified', example='2023-07-13T17:29:54'),
        ip?: string(name='Ip', example='xxx.xxx.xxx.1'),
        latelyHeartbeatTimeSec?: long(name='LatelyHeartbeatTimeSec', example='1689250071'),
        name?: string(name='Name', example='xxx.xxx.xxx.1-7145:OB_ORACLE_np_4w3r***_4w:0000***97'),
        port?: int32(name='Port', example='2883'),
        region?: string(name='Region', example='cn-shanghai'),
        status?: string(name='Status', example='EXCEPTION'),
        storePort?: int32(name='StorePort', example='2882'),
        subtopic?: string(name='Subtopic', description='SubTopic。', example='OB_ORACLE_np_4w3***c_4w3**-0'),
        toSwitch?: boolean(name='ToSwitch', example='false'),
        topic?: string(name='Topic', description='Topic。', example='OB_ORACLE_np_4w3r29c_4w3****'),
        tps?: long(name='Tps', example='0'),
      }
    ](name='StoreList'),
  }(name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='9'),
}

model DescribeProjectComponentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectComponentsResponseBody(name='body'),
}

/**
 * @summary 获取项目的组件信息
 *
 * @param request DescribeProjectComponentsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectComponentsResponse
 */
async function describeProjectComponentsWithOptions(request: DescribeProjectComponentsRequest, runtime: Util.RuntimeOptions): DescribeProjectComponentsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeProjectComponents',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取项目的组件信息
 *
 * @param request DescribeProjectComponentsRequest
 * @return DescribeProjectComponentsResponse
 */
async function describeProjectComponents(request: DescribeProjectComponentsRequest): DescribeProjectComponentsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProjectComponentsWithOptions(request, runtime);
}

model DescribeProjectProgressRequest {
  id?: string(name='Id', description='This parameter is required.', example='np_4w3a****'),
}

model DescribeProjectProgressResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: {
    alarmLevel?: string(name='AlarmLevel', example='MEDIUM'),
    currentStep?: string(name='CurrentStep', example='PRE_CHECK'),
    enableFullTransfer?: boolean(name='EnableFullTransfer', example='true'),
    enableIncrSync?: boolean(name='EnableIncrSync', example='true'),
    enableReverseIncrTransfer?: boolean(name='EnableReverseIncrTransfer', example='true'),
    enableStructTransfer?: boolean(name='EnableStructTransfer', example='true'),
    fullTransferProgress?: int32(name='FullTransferProgress', example='100'),
    incrSyncCheckpoint?: long(name='IncrSyncCheckpoint', example='1689248064'),
    projectId?: string(name='ProjectId', example='np_fe****'),
    reverseIncrTransferCheckpoint?: long(name='ReverseIncrTransferCheckpoint', example='1689248075'),
    status?: string(name='Status', example='RUNNING'),
    structTransferProgress?: int32(name='StructTransferProgress', example='100'),
  }(name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='1'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='1'),
}

model DescribeProjectProgressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectProgressResponseBody(name='body'),
}

/**
 * @summary 获取迁移/同步项目 Progress 信息
 *
 * @param request DescribeProjectProgressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectProgressResponse
 */
async function describeProjectProgressWithOptions(request: DescribeProjectProgressRequest, runtime: Util.RuntimeOptions): DescribeProjectProgressResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeProjectProgress',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取迁移/同步项目 Progress 信息
 *
 * @param request DescribeProjectProgressRequest
 * @return DescribeProjectProgressResponse
 */
async function describeProjectProgress(request: DescribeProjectProgressRequest): DescribeProjectProgressResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProjectProgressWithOptions(request, runtime);
}

model DescribeProjectStepMetricRequest {
  aggregator?: string(name='Aggregator', description='This parameter is required.', example='AVG'),
  beginTimestamp?: long(name='BeginTimestamp', description='This parameter is required.', example='1689244696'),
  endTimestamp?: long(name='EndTimestamp', description='This parameter is required.', example='1689254646'),
  maxPointNum?: int32(name='MaxPointNum', example='6'),
  metricType?: string(name='MetricType', description='This parameter is required.', example='RPS'),
  projectId?: string(name='ProjectId', description='This parameter is required.', example='np_dr****'),
  stepName?: string(name='StepName', description='This parameter is required.', example='FULL_TRANSFER'),
}

model DescribeProjectStepMetricResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: {
    aggregator?: string(name='Aggregator', example='AVG'),
    metrics?: [ 
      {
        dataPoints?: [ 
          {
            timestamp?: long(name='Timestamp', example='1689244696'),
            value?: double(name='Value', example='0'),
          }
        ](name='DataPoints'),
        name?: string(name='Name', example='metric_name'),
        tags?: map[string]string(name='Tags'),
      }
    ](name='Metrics'),
    referenceValue?: long(name='ReferenceValue', example='null'),
  }(name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='1'),
}

model DescribeProjectStepMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectStepMetricResponseBody(name='body'),
}

/**
 * @summary 查询项目步骤指标
 *
 * @param request DescribeProjectStepMetricRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectStepMetricResponse
 */
async function describeProjectStepMetricWithOptions(request: DescribeProjectStepMetricRequest, runtime: Util.RuntimeOptions): DescribeProjectStepMetricResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.aggregator)) {
    body['Aggregator'] = request.aggregator;
  }
  if (!Util.isUnset(request.beginTimestamp)) {
    body['BeginTimestamp'] = request.beginTimestamp;
  }
  if (!Util.isUnset(request.endTimestamp)) {
    body['EndTimestamp'] = request.endTimestamp;
  }
  if (!Util.isUnset(request.maxPointNum)) {
    body['MaxPointNum'] = request.maxPointNum;
  }
  if (!Util.isUnset(request.metricType)) {
    body['MetricType'] = request.metricType;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.stepName)) {
    body['StepName'] = request.stepName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeProjectStepMetric',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询项目步骤指标
 *
 * @param request DescribeProjectStepMetricRequest
 * @return DescribeProjectStepMetricResponse
 */
async function describeProjectStepMetric(request: DescribeProjectStepMetricRequest): DescribeProjectStepMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProjectStepMetricWithOptions(request, runtime);
}

model DescribeProjectStepsRequest {
  id?: string(name='Id', description='This parameter is required.', example='np_4w3a****'),
}

model DescribeProjectStepsResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: [ 
    {
      description?: string(name='Description'),
      extraInfo?: {
        errorCode?: string(name='ErrorCode', example='INNER_ERROR'),
        errorDetails?: [ 
          {
            code?: string(name='Code', example='CM-RESOAT1111'),
            extraContext?: map[string]any(name='ExtraContext'),
            level?: string(name='Level', example='ERROR'),
            message?: string(name='Message', example='A system error occurred.'),
            messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
            messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
            proposal?: string(name='Proposal', example='null'),
            proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
            proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
            reason?: string(name='Reason', example='null'),
            reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
            reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
            upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
          }
        ](name='ErrorDetails'),
        errorMsg?: string(name='ErrorMsg', example='The ResourceDirectoryId is invalid.'),
        errorParam?: map[string]string(name='ErrorParam'),
        failedTime?: string(name='FailedTime', example='null'),
      }(name='ExtraInfo'),
      finishTime?: string(name='FinishTime', example='2020-05-22T17:04:18'),
      name?: string(name='Name', example='PRE_CHECK'),
      order?: int32(name='Order', example='1'),
      progress?: int32(name='Progress', example='100'),
      startTime?: string(name='StartTime', example='2020-05-22T17:04:18'),
      status?: string(name='Status', example='RUNNING'),
      stepInfo?: map[string]any(name='StepInfo', example='null'),
    }
  ](name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='4'),
}

model DescribeProjectStepsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectStepsResponseBody(name='body'),
}

/**
 * @summary 查询项目步骤
 *
 * @param request DescribeProjectStepsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectStepsResponse
 */
async function describeProjectStepsWithOptions(request: DescribeProjectStepsRequest, runtime: Util.RuntimeOptions): DescribeProjectStepsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeProjectSteps',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询项目步骤
 *
 * @param request DescribeProjectStepsRequest
 * @return DescribeProjectStepsResponse
 */
async function describeProjectSteps(request: DescribeProjectStepsRequest): DescribeProjectStepsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProjectStepsWithOptions(request, runtime);
}

model DescribeProxyServiceRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob317v4uif****'),
}

model DescribeProxyServiceResponseBody = {
  data?: {
    createTime?: string(name='CreateTime', example='2023-07-05T08:23:10Z'),
    currentEndpointNum?: long(name='CurrentEndpointNum', example='1'),
    endpointNumQuota?: long(name='EndpointNumQuota', example='3'),
    expireTime?: string(name='ExpireTime', example='2123-07-05T16:00:00'),
    proxyClusterId?: string(name='ProxyClusterId', example='proxy-3t****zrieasg'),
    proxyMode?: string(name='ProxyMode', example='shared'),
    proxyServiceVersion?: string(name='ProxyServiceVersion', example='1.0'),
    proxyVersion?: string(name='ProxyVersion', example='4.3.1.0-xxxxxxxxx'),
    status?: string(name='Status', example='ONLINE'),
    unitNum?: long(name='UnitNum', example='1'),
    unitNumLimit?: long(name='UnitNumLimit', example='4'),
    unitSpec?: string(name='UnitSpec', example='4C8GB'),
    zone?: string(name='Zone', example='cn-shanghai-e,cn-shanghai-f'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeProxyServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProxyServiceResponseBody(name='body'),
}

/**
 * @summary 查询代理服务信息
 *
 * @param request DescribeProxyServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProxyServiceResponse
 */
async function describeProxyServiceWithOptions(request: DescribeProxyServiceRequest, runtime: Util.RuntimeOptions): DescribeProxyServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeProxyService',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询代理服务信息
 *
 * @param request DescribeProxyServiceRequest
 * @return DescribeProxyServiceResponse
 */
async function describeProxyService(request: DescribeProxyServiceRequest): DescribeProxyServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProxyServiceWithOptions(request, runtime);
}

model DescribeRecommendIndexRequest {
  instanceId?: string(name='InstanceId', description='The return result of the request.

This parameter is required.', example='ob317v4uif****'),
  SQLId?: string(name='SQLId', description='The ID of the OceanBase cluster.

This parameter is required.', example='8D6E84****0B8FB1823D199E2CA1****'),
  tenantId?: string(name='TenantId', description='The index recommended for the SQL statement after calculation by the diagnostic system.   
- If the recommended index is the primary key, PRIMARY is returned.  
- If an index created by the user is recommended, the index name is returned.   
The system recommends only one index for an SQL statement. You can call the DescribeIndexes operation to view the indexes of a table.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeRecommendIndexResponseBody = {
  recommendIndex?: {
    suggestIndex?: string(name='SuggestIndex', description='Example 1', example='PRIMARY'),
    tableList?: string(name='TableList', example='testtable'),
    tenantMode?: string(name='TenantMode', example='mysql'),
  }(name='RecommendIndex', description='The information about the recommended index.'),
  requestId?: string(name='RequestId', description='The tenant mode.   Valid values:  
Oracle   
MySQL', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeRecommendIndexResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRecommendIndexResponseBody(name='body'),
}

/**
 * @summary The tenant mode.   Valid values:  
 * Oracle   
 * MySQL
 *
 * @param request DescribeRecommendIndexRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRecommendIndexResponse
 */
async function describeRecommendIndexWithOptions(request: DescribeRecommendIndexRequest, runtime: Util.RuntimeOptions): DescribeRecommendIndexResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.SQLId)) {
    body['SQLId'] = request.SQLId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRecommendIndex',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The tenant mode.   Valid values:  
 * Oracle   
 * MySQL
 *
 * @param request DescribeRecommendIndexRequest
 * @return DescribeRecommendIndexResponse
 */
async function describeRecommendIndex(request: DescribeRecommendIndexRequest): DescribeRecommendIndexResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRecommendIndexWithOptions(request, runtime);
}

model DescribeRestorableTenantsRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  isOnline?: boolean(name='IsOnline', description='Specifies whether the target cluster is online. **Note** This parameter is used for compatibility with earlier versions and can be left empty. When left empty, it specifies negation for the value of `isRemote`.', example='true'),
  isRemote?: boolean(name='IsRemote', description='This parameter is provided for compatibility with earlier versions and can be left empty.', example='true'),
  method?: string(name='Method', description='The backup method.', example='native_logical'),
  restoreMode?: string(name='RestoreMode', description='The restore method. This parameter is required when `IsRemote` is set to `true`, and is optional otherwise.', example='from_time_point'),
  restoreObjectType?: string(name='RestoreObjectType', description='The type of the restore object.', example='tenant'),
  setId?: string(name='SetId', description='The ID of the backup set.', example='bak-xxxxx'),
}

model DescribeRestorableTenantsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  tenants?: [ 
    {
      backupBucketName?: string(name='BackupBucketName', description='The name of the backup directory.', example='backup'),
      backupSets?: [ 
        {
          backupSetId?: string(name='BackupSetId', description='The ID of the full backup set used for restore.', example='bak-4n****gacpa8'),
          checkpoint?: string(name='Checkpoint', description='The checkpoint of the backup set.', example='2024-01-01\\\\"T\\\\"12:10:10.000\\\\"Z\\\\"'),
          setId?: string(name='SetId', description='The ID of the backup set.', example='bak-xxxxx'),
          tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t5********'),
        }
      ](name='BackupSets', description='The list of backup sets.'),
      clusterId?: string(name='ClusterId', description='The ID of the cluster.', example='objnf3b2****'),
      clusterName?: string(name='ClusterName', description='The name of the cluster.', example='testCluster'),
      cpuNum?: long(name='CpuNum', description='The number of CPU cores.', example='1'),
      memoryNum?: long(name='MemoryNum', description='The size of memory for the tenant.', example='100'),
      method?: string(name='Method', description='The backup method.', example='logical'),
      obRpmVersion?: string(name='ObRpmVersion', description='The version of the OceanBase Database RPM package.', example='3.2.3.1-2022080510****'),
      obTenantId?: string(name='ObTenantId', description='The ID of the tenant.', example='tvd43v****'),
      obVersion?: string(name='ObVersion', description='The major version of OceanBase Database.', example='3.2.3.1'),
      sourceRegion?: string(name='SourceRegion', description='The region of the cluster.', example='cn-hangzhou'),
      tenantAlias?: string(name='TenantAlias', description='The alias of the tenant.', example='aaa'),
      tenantDataBackupRemainDays?: int32(name='TenantDataBackupRemainDays', description='The remaining validity period, in days, of the backup data of the tenant.', example='7'),
      tenantId?: string(name='TenantId', description='The ID of the tenant.', example='ob317v4uif****'),
      tenantMode?: string(name='TenantMode', description='The mode of the tenant.', example='Oracle'),
      tenantName?: string(name='TenantName', description='The name of the tenant.', example='sbtest1'),
      timeIntervalList?: [ 
        {
          endTime?: string(name='EndTime', description='The end time of the restorable period.', example='2023-03-13T02:43:03Z'),
          fromArchive?: boolean(name='FromArchive', description='Indicates whether the restore is based on archiving.', example='true'),
          startTime?: string(name='StartTime', description='The start time of the restorable period.', example='2023-01-20T16:00:00Z'),
          storageType?: string(name='StorageType', description='The storage type of backup data.', example='standard'),
        }
      ](name='TimeIntervalList', description='The list of restorable periods of the tenant.'),
      unitNum?: long(name='UnitNum', description='The number of nodes of the tenant.', example='2'),
      usedDisk?: long(name='UsedDisk', description='The size of disk space for the tenant.', example='50'),
    }
  ](name='Tenants', description='The information about the tenants.'),
  totalCount?: int32(name='TotalCount', description='The total number.', example='6'),
}

model DescribeRestorableTenantsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRestorableTenantsResponseBody(name='body'),
}

/**
 * @summary Queries information about restorable OceanBase Database tenants.
 *
 * @param request DescribeRestorableTenantsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRestorableTenantsResponse
 */
async function describeRestorableTenantsWithOptions(request: DescribeRestorableTenantsRequest, runtime: Util.RuntimeOptions): DescribeRestorableTenantsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.isOnline)) {
    body['IsOnline'] = request.isOnline;
  }
  if (!Util.isUnset(request.isRemote)) {
    body['IsRemote'] = request.isRemote;
  }
  if (!Util.isUnset(request.method)) {
    body['Method'] = request.method;
  }
  if (!Util.isUnset(request.restoreMode)) {
    body['RestoreMode'] = request.restoreMode;
  }
  if (!Util.isUnset(request.restoreObjectType)) {
    body['RestoreObjectType'] = request.restoreObjectType;
  }
  if (!Util.isUnset(request.setId)) {
    body['SetId'] = request.setId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRestorableTenants',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries information about restorable OceanBase Database tenants.
 *
 * @param request DescribeRestorableTenantsRequest
 * @return DescribeRestorableTenantsResponse
 */
async function describeRestorableTenants(request: DescribeRestorableTenantsRequest): DescribeRestorableTenantsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRestorableTenantsWithOptions(request, runtime);
}

model DescribeSQLDetailsRequest {
  SQLId?: string(name='SQLId', description='The SQL text.

This parameter is required.', example='8D6E84****0B8FB1823D199E2CA1****'),
  tenantId?: string(name='TenantId', description='SQLID.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeSQLDetailsResponseBody = {
  requestId?: string(name='RequestId', description='The operation that you want to perform.   
Set the value to **DescribeSQLDetails**.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  SQLDetails?: [ 
    {
      dbName?: string(name='DbName', example='testdb'),
      SQLText?: string(name='SQLText', description='{"name":"DescribeSQLDetails","product":"OceanBasePro","version":"2019-09-01","path":"/","deprecated":0,"method":"POST|GET","protocol":"HTTP|HTTPS","hidden":0,"timeout":10000,"parameter_type":"Single","params":"[{\\\\"name\\\\":\\\\"Action\\\\",\\\\"position\\\\":\\\\"Query\\\\",\\\\"required\\\\":true,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"DescribeSQLDetails\\\\"},{\\\\"name\\\\":\\\\"TenantId\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":true,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"t2mr3oae0****\\\\"},{\\\\"name\\\\":\\\\"SQLId\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":true,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"SQLID\\\\",\\\\"description\\\\":\\\\"SQLID。\\\\",\\\\"example\\\\":\\\\"8D6E84****0B8FB1823D199E2CA1****\\\\"}]","response_headers":"[]","response":"{\\\\"type\\\\":\\\\"Object\\\\",\\\\"children\\\\":[{\\\\"name\\\\":\\\\"RequestId\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E\\\\"},{\\\\"name\\\\":\\\\"SQLDetails\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"Array\\\\",\\\\"subType\\\\":\\\\"Object\\\\",\\\\"description\\\\":\\\\"  \\\\",\\\\"children\\\\":[{\\\\"name\\\\":\\\\"SQLText\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"SELECT  ****   FROM ****   WHERE **** = ? AND **** = ?   ORDER BY **** ASC\\\\"},{\\\\"name\\\\":\\\\"DbName\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"testdb\\\\"},{\\\\"name\\\\":\\\\"UserName\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"tester\\\\"}],\\\\"title\\\\":\\\\"\\\\"}],\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\"}","errors":"{}"}', example='SELECT  ****   FROM ****   WHERE **** = ? AND **** = ?   ORDER BY **** ASC'),
      userName?: string(name='UserName', example='tester'),
    }
  ](name='SQLDetails', description='```
http(s)://[Endpoint]/?Action=DescribeSQLDetails
&TenantId=t2mr3oae0****
&SQLId=8D6E84****0B8FB1823D199E2CA1****
&Common request parameters
```'),
}

model DescribeSQLDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSQLDetailsResponseBody(name='body'),
}

/**
 * @summary The username.
 *
 * @param request DescribeSQLDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSQLDetailsResponse
 */
async function describeSQLDetailsWithOptions(request: DescribeSQLDetailsRequest, runtime: Util.RuntimeOptions): DescribeSQLDetailsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.SQLId)) {
    body['SQLId'] = request.SQLId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSQLDetails',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The username.
 *
 * @param request DescribeSQLDetailsRequest
 * @return DescribeSQLDetailsResponse
 */
async function describeSQLDetails(request: DescribeSQLDetailsRequest): DescribeSQLDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLDetailsWithOptions(request, runtime);
}

model DescribeSQLHistoryListRequest {
  endTime?: string(name='EndTime', description='The end time of the time range for querying the SQL execution history.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-09-13T15:40:43Z'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page.   
Default value: 10.', example='10'),
  SQLId?: string(name='SQLId', description='SQLID.

This parameter is required.', example='8D6E84****0B8FB1823D199E2CA1****'),
  startTime?: string(name='StartTime', description='The start time of the time range for querying the SQL execution history.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-06-13T15:40:43Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeSQLHistoryListResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  SQLHistoryList?: {
    count?: long(name='Count', description='The quantity.', example='1'),
    list?: [ 
      {
        affectedRows?: long(name='AffectedRows', description='The number of rows affected.', example='0'),
        appWaitTime?: float(name='AppWaitTime', description='The wait time of the client.', example='0.0'),
        blockCacheHit?: long(name='BlockCacheHit', description='The number of block cache hits.', example='14'),
        blockIndexCacheHit?: long(name='BlockIndexCacheHit', description='The number of block index cache hits.', example='4'),
        bloomFilterCacheHit?: long(name='BloomFilterCacheHit', description='The number of Bloom filter cache hits.', example='0'),
        clientIp?: string(name='ClientIp', description='The IP address of the client.', example='1*2.***.1*3.***'),
        concurrencyWaitTime?: float(name='ConcurrencyWaitTime', description='The wait time in concurrent execution.', example='0.0'),
        cpuTime?: float(name='CpuTime', description='The average CPU time.', example='50.13'),
        dbName?: string(name='DbName', description='The name of the database.', example='testdb'),
        decodeTime?: float(name='DecodeTime', description='The time to wait for decoding.', example='0.0'),
        diskRead?: long(name='DiskRead', description='The number of physical reads.', example='0'),
        elapsedTime?: float(name='ElapsedTime', description='The average response time.', example='76.382'),
        endTime?: long(name='EndTime', description='The end time.', example='2021-12-28T02:08:18Z'),
        endTimeUTCString?: string(name='EndTimeUTCString', description='The end time in UTC +0.', example='2021-12-28T02:08:18Z'),
        event?: string(name='Event', description='The wait event.', example='mysql response wait client'),
        execPerSecond?: long(name='ExecPerSecond', description='The number of executions per second.', example='163.0'),
        executeTime?: float(name='ExecuteTime', description='The internal execution time.', example='61.044'),
        executions?: long(name='Executions', description='The number of executions.', example='89403'),
        failTimes?: long(name='FailTimes', description='The number of failures.', example='0'),
        getPlanTime?: float(name='GetPlanTime', description='The time spent in hard parsing.', example='0.052'),
        IOWaitTime?: float(name='IOWaitTime', description='The I/O wait time.', example='0.0'),
        logicalRead?: long(name='LogicalRead', description='The number of logical reads.', example='19'),
        maxCpuTime?: float(name='MaxCpuTime', description='The maximum CPU time.', example='257.967'),
        maxElapsedTime?: float(name='MaxElapsedTime', description='The maximum response time.', example='260.44'),
        memstoreReadRowCount?: long(name='MemstoreReadRowCount', description='The number of rows read from the memory.', example='527'),
        missPlans?: long(name='MissPlans', description='The number of plan misses.', example='0'),
        netWaitTime?: float(name='NetWaitTime', description='The network latency.', example='0.0'),
        nodeIp?: string(name='NodeIp', description='The IP address of the node.', example='i-bp18qljorblo8es*****'),
        queueTime?: float(name='QueueTime', description='The queuing time.', example='15.275'),
        RPCCount?: long(name='RPCCount', description='The number of RPCs.', example='0'),
        remotePlans?: long(name='RemotePlans', description='The number of remote plans.', example='0'),
        retryCount?: long(name='RetryCount', description='The number of retries.', example='0'),
        returnRows?: long(name='ReturnRows', description='The number of rows returned.', example='1'),
        rowCacheHit?: long(name='RowCacheHit', description='The number of row cache hits.', example='0'),
        scheduleTime?: float(name='ScheduleTime', description='The scheduling duration.', example='0.0'),
        ssstoreReadRowCount?: long(name='SsstoreReadRowCount', description='The number of rows read from the disk.', example='43086'),
        totalWaitTime?: float(name='TotalWaitTime', description='The internal wait time.', example='10.966'),
        userName?: string(name='UserName', description='The username.', example='tester'),
      }
    ](name='List'),
  }(name='SQLHistoryList', description='The execution history of the SQL statement.'),
}

model DescribeSQLHistoryListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSQLHistoryListResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the execution history of an SQL statement in a specified period based on an SQL ID.
 *
 * @param request DescribeSQLHistoryListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSQLHistoryListResponse
 */
async function describeSQLHistoryListWithOptions(request: DescribeSQLHistoryListRequest, runtime: Util.RuntimeOptions): DescribeSQLHistoryListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.SQLId)) {
    body['SQLId'] = request.SQLId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSQLHistoryList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the execution history of an SQL statement in a specified period based on an SQL ID.
 *
 * @param request DescribeSQLHistoryListRequest
 * @return DescribeSQLHistoryListResponse
 */
async function describeSQLHistoryList(request: DescribeSQLHistoryListRequest): DescribeSQLHistoryListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLHistoryListWithOptions(request, runtime);
}

model DescribeSQLPlansRequest {
  SQLId?: string(name='SQLId', description='SQLID.

This parameter is required.', example='8D6E84****0B8FB1823D199E2CA1****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeSQLPlansResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  SQLPlans?: [ 
    {
      avgExecutionMS?: float(name='AvgExecutionMS', description='The average execution duration, in ms.', example='1'),
      avgExecutionTimeMS?: long(name='AvgExecutionTimeMS', description='The average execution duration when the database uses this execution plan, in ms.', example='288'),
      firstLoadTime?: long(name='FirstLoadTime', description='The time when the plan was loaded for the first time, .', example='1641492303000'),
      firstLoadTimeUTCString?: string(name='FirstLoadTimeUTCString', description='The time when the plan was loaded for the first time, in UTC +0.', example='2022-01-06T18:05:03Z'),
      hitCount?: int32(name='HitCount', description='The number of hits.', example='3'),
      mergedVersion?: int32(name='MergedVersion', description='The major compaction version.', example='132'),
      nodeIp?: string(name='NodeIp', description='The IP address of the node.', example='i-bp16niirq4zdmgvm****'),
      outlineData?: string(name='OutlineData', description='The outline data.'),
      outlineId?: long(name='OutlineId', description='OutlineID.', example='-1'),
      outlineTime?: long(name='OutlineTime', description='The time when the plan was bound.', example='1641492303000'),
      outlineTimeUTCString?: string(name='OutlineTimeUTCString', description='The time when the plan was bound, in UTC +0.', example='2022-01-06T18:05:03Z'),
      planFull?: string(name='PlanFull', description='The complete execution plan of the SQL statement.', example='PHY_TABLE_SCAN | bmsql_order_line | 40 ******'),
      planId?: int32(name='PlanId', description='The ID of the SQL execution plan in the database.', example='9114'),
      planInfo?: string(name='PlanInfo', description='The information about the plan.', example='PHY_TABLE_SCAN'),
      planUnionHash?: string(name='PlanUnionHash', description='The unique identifier of the SQL execution plan in the diagnostic system.', example='859ef7ee****b23ac98cdeb2476f****'),
      querySQL?: string(name='QuerySQL', description='The query SQL statement.', example='SELECT ol_i_id, ***, *** FROM aaa'),
    }
  ](name='SQLPlans', description='The information about the execution plan.'),
}

model DescribeSQLPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSQLPlansResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the information about the SQL execution plans stored in the diagnostic system based on an SQL ID.
 *
 * @param request DescribeSQLPlansRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSQLPlansResponse
 */
async function describeSQLPlansWithOptions(request: DescribeSQLPlansRequest, runtime: Util.RuntimeOptions): DescribeSQLPlansResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.SQLId)) {
    body['SQLId'] = request.SQLId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSQLPlans',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the information about the SQL execution plans stored in the diagnostic system based on an SQL ID.
 *
 * @param request DescribeSQLPlansRequest
 * @return DescribeSQLPlansResponse
 */
async function describeSQLPlans(request: DescribeSQLPlansRequest): DescribeSQLPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLPlansWithOptions(request, runtime);
}

model DescribeSQLSamplesRequest {
  dbName?: string(name='DbName', description='The database name.

This parameter is required.', example='test_db'),
  endTime?: string(name='EndTime', description='The end time of querying the slow query execution.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T05:38:38Z'),
  instanceId?: string(name='InstanceId', description='The instance ID.', example='ob317v4uif****'),
  returnSqlText?: boolean(name='ReturnSqlText', description='Specifies whether to return the SQL text.', example='true'),
  sqlId?: string(name='SqlId', description='SQL ID.

This parameter is required.', example='8D6E84****0B8FB1823D199E2CA1****'),
  startTime?: string(name='StartTime', description='The start time of querying the slow query execution.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2023-04-12T04:38:38Z'),
  tenantId?: string(name='TenantId', description='The tenant ID.', example='t4louaeei****'),
}

model DescribeSQLSamplesResponseBody = {
  data?: [ 
    {
      affectedRows?: double(name='AffectedRows', description='Average updated rows during the execution period.', example='10000.0'),
      applicationWaitTime?: double(name='ApplicationWaitTime', description='Application event waiting time (in milliseconds).', example='0.0'),
      blockCacheHit?: double(name='BlockCacheHit', description='BlockCache hit count', example='99279.0'),
      blockIndexCacheHit?: double(name='BlockIndexCacheHit', description='BlockIndexCache hit count', example='142514.0'),
      bloomFilterCacheHit?: double(name='BloomFilterCacheHit', description='BloomFilterCache hit count.', example='0.0'),
      clientIp?: string(name='ClientIp', description='Client IP.', example='i-bp1db****38uemejio'),
      clientPort?: string(name='ClientPort', description='Client port.', example='4****'),
      concurrencyWaitTime?: double(name='ConcurrencyWaitTime', description='Concurrency event waiting time (in milliseconds).', example='0.0'),
      consistencyLevel?: string(name='ConsistencyLevel', description='Consistency level.', example='3'),
      cpuTime?: double(name='CpuTime', description='CPU time (in milliseconds).', example='3377.57'),
      dbName?: string(name='DbName', description='Database name.', example='test_db'),
      decodeTime?: double(name='DecodeTime', description='Syntax parsing time (in milliseconds).', example='0.0'),
      diskReads?: double(name='DiskReads', description='Disk read count.', example='96972.0'),
      elapsedTime?: double(name='ElapsedTime', description='Response time (in milliseconds).', example='2182.66'),
      executeTime?: double(name='ExecuteTime', description='Plan execution time (in milliseconds).', example='8262.01'),
      executorRpc?: boolean(name='ExecutorRpc', description='Whether to initiate RPC.', example='0.0'),
      expectedWorkerCount?: double(name='ExpectedWorkerCount', description='Degree of parallelism.', example='0'),
      fullSqlText?: string(name='FullSqlText', description='The full SQL text. 

> This parameter is unavailable.', example='select * from test where c1 > 1 and c2 > 3;'),
      getPlanTime?: double(name='GetPlanTime', description='Plan generation time (in milliseconds).', example='0.19'),
      hitPlan?: boolean(name='HitPlan', description='Whether to hit the execution plan.', example='true'),
      inner?: boolean(name='Inner', description='Whether an internal SQL.', example='false'),
      memstoreReadRows?: double(name='MemstoreReadRows', description='Memstore read row count.', example='0'),
      netTime?: double(name='NetTime', description='Network transmission time (in milliseconds).', example='0.0'),
      netWaitTime?: double(name='NetWaitTime', description='Network enqueue time (in milliseconds).', example='0.0'),
      obDbId?: double(name='ObDbId', description='Database ID.', example='11006111****4828'),
      obServerId?: double(name='ObServerId', description='Server  ID.', example='2'),
      obUserId?: double(name='ObUserId', description='User ID.', example='100010'),
      paramsValue?: string(name='ParamsValue', description='The parameter value of the SQL statement.', example='1****'),
      partitionCount?: double(name='PartitionCount', description='Average number of partition accessed during the execution period.', example='1.0'),
      planId?: double(name='PlanId', description='The execution plan ID.', example='590****'),
      planType?: string(name='PlanType', description='Plan type.', example='LOCAL'),
      queueTime?: double(name='QueueTime', description='Queueing time (in milliseconds).', example='0.02'),
      requestId?: string(name='RequestId', description='Request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
      requestTime?: string(name='RequestTime', description='SQL request time.', example='2023-04-12T04:46:38Z'),
      retCode?: double(name='RetCode', description='Result code.', example='0'),
      retryCount?: double(name='RetryCount', description='Retry count.', example='0'),
      returnRows?: double(name='ReturnRows', description='Average returned rows during the execution period.', example='0.0'),
      rowCacheHit?: double(name='RowCacheHit', description='RowCache hit count.', example='498.0'),
      rpcCount?: double(name='RpcCount', description='Number of RPC sent.', example='8.0'),
      scheduleTime?: double(name='ScheduleTime', description='Schedule event waiting time (in milliseconds).', example='0.0'),
      server?: string(name='Server', description='The server where the SQL is executed.', example='i-bp1db1****8uemejio'),
      sqlText?: string(name='SqlText', description='The SQL text.', example='select ** from t'),
      sqlType?: string(name='SqlType', description='SQL type.', example='select'),
      ssstoreReadRows?: double(name='SsstoreReadRows', description='Ssstore read row count.', example='986190'),
      statement?: string(name='Statement', description='Parameterized SQL text.', example='select a from b'),
      tableScan?: boolean(name='TableScan', description='Whether to perform full table scan.', example='false'),
      traceId?: string(name='TraceId', description='Trace ID.', example='YB42C****-0005E303D1****-0-0'),
      transHash?: string(name='TransHash', description='Transaction hash.', example='1219****927****73791'),
      usedWorkerCount?: double(name='UsedWorkerCount', description='Actual number of SQL execution threads.', example='0'),
      userIoWaitTime?: double(name='UserIoWaitTime', description='UserIO event waiting time (in milliseconds).', example='0.0'),
      userName?: string(name='UserName', description='Username.', example='test_user'),
      waitCount?: double(name='WaitCount', description='Wait count.', example='0.0'),
      waitEvent?: string(name='WaitEvent', description='Longest wait event during the execution period.', example='none'),
      waitTime?: double(name='WaitTime', description='Wait time (in milliseconds).', example='0.0'),
    }
  ](name='Data', description='The list of sample data of slow query execution details.'),
  requestId?: string(name='RequestId', description='Request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeSQLSamplesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSQLSamplesResponseBody(name='body'),
}

/**
 * @summary You can call this API to view the sample data of the execution details of the slow queries.
 *
 * @param request DescribeSQLSamplesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSQLSamplesResponse
 */
async function describeSQLSamplesWithOptions(request: DescribeSQLSamplesRequest, runtime: Util.RuntimeOptions): DescribeSQLSamplesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.returnSqlText)) {
    body['ReturnSqlText'] = request.returnSqlText;
  }
  if (!Util.isUnset(request.sqlId)) {
    body['SqlId'] = request.sqlId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSQLSamples',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this API to view the sample data of the execution details of the slow queries.
 *
 * @param request DescribeSQLSamplesRequest
 * @return DescribeSQLSamplesResponse
 */
async function describeSQLSamples(request: DescribeSQLSamplesRequest): DescribeSQLSamplesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLSamplesWithOptions(request, runtime);
}

model DescribeSQLTuningAdvicesRequest {
  acceptLanguage?: string(name='AcceptLanguage', example='zh-CN'),
  dbName?: string(name='DbName', description='This parameter is required.', example='testdb'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2023-04-12T05:38:38Z'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='obsdf43****'),
  sqlId?: string(name='SqlId', description='SqlId

This parameter is required.', example='123456'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2023-04-12T04:38:38Z'),
  tenantId?: string(name='TenantId', description='This parameter is required.', example='tsdc2s2****'),
}

model DescribeSQLTuningAdvicesResponseBody = {
  data?: [ 
    {
      columnNames?: string(name='ColumnNames', example='c1;c2;c3'),
      columns?: [ 
        {
          columnName?: string(name='ColumnName', example='xxxx'),
          maxValue?: string(name='MaxValue', example='100'),
          minValue?: string(name='MinValue', example='1'),
          ndv?: float(name='Ndv', description='NDV', example='100'),
        }
      ](name='Columns'),
      dbName?: string(name='DbName', example='test_db'),
      localityType?: string(name='LocalityType', example='Local/Global'),
      plan?: {
        avgApplicationWaitTime?: float(name='AvgApplicationWaitTime', example='0'),
        avgBufferGets?: float(name='AvgBufferGets', example='0'),
        avgConcurrencyWaitTime?: float(name='AvgConcurrencyWaitTime', example='0'),
        avgCpuTime?: float(name='AvgCpuTime', example='100.36'),
        avgDiskReads?: float(name='AvgDiskReads', example='0'),
        avgDiskWrites?: float(name='AvgDiskWrites', example='0'),
        avgElapsedTime?: float(name='AvgElapsedTime', example='713.62'),
        avgRowProcessed?: float(name='AvgRowProcessed', example='1'),
        avgUserIoWaitTime?: float(name='AvgUserIoWaitTime', example='0'),
        collectTimeUs?: long(name='CollectTimeUs', example='1672358400000000'),
        delayedLargeQueryPercentage?: float(name='DelayedLargeQueryPercentage', example='0'),
        execPs?: float(name='ExecPs', example='1.45'),
        executions?: long(name='Executions', example='2062'),
        firstLoadTime?: string(name='FirstLoadTime', example='2022-12-30T02:25:30.576Z'),
        firstLoadTimeUs?: long(name='FirstLoadTimeUs', example='1672367130576163'),
        hitDiagnosis?: boolean(name='HitDiagnosis', example='false'),
        hitPercentage?: float(name='HitPercentage', example='66.8'),
        largeQueryPercentage?: float(name='LargeQueryPercentage', example='0'),
        mergedVersion?: long(name='MergedVersion', example='3'),
        obDbId?: long(name='ObDbId', example='1108307720799259'),
        obServerId?: long(name='ObServerId', description='server  ID。', example='1'),
        outlineData?: string(name='OutlineData', example='xxxxx'),
        outlineId?: long(name='OutlineId', description='Outline ID。', example='1'),
        planHash?: string(name='PlanHash', example='-86290582****886880'),
        planId?: long(name='PlanId', example='818'),
        planSize?: long(name='PlanSize', example='49216'),
        planType?: string(name='PlanType', example='LOCAL'),
        schemaVersion?: long(name='SchemaVersion', example='1672367130529680'),
        serverSn?: string(name='ServerSn', example='i-bp1*****sw64dhb*****'),
        tableScan?: boolean(name='TableScan', example='false'),
        timeoutPercentage?: float(name='TimeoutPercentage', example='0'),
        uid?: string(name='Uid', example='AAAAAAAAAAEAAAAAAAADMgAF8QJQwIUj'),
      }(name='Plan'),
      table?: string(name='Table', example='test_table'),
      type?: string(name='Type', example='PLAN_BINDING/INDEX_CREATION'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model DescribeSQLTuningAdvicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSQLTuningAdvicesResponseBody(name='body'),
}

/**
 * @summary 获取单个 SQL 的调优建议，包括计划推荐和索引推荐
 *
 * @param request DescribeSQLTuningAdvicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSQLTuningAdvicesResponse
 */
async function describeSQLTuningAdvicesWithOptions(request: DescribeSQLTuningAdvicesRequest, runtime: Util.RuntimeOptions): DescribeSQLTuningAdvicesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    body['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.sqlId)) {
    body['SqlId'] = request.sqlId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSQLTuningAdvices',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取单个 SQL 的调优建议，包括计划推荐和索引推荐
 *
 * @param request DescribeSQLTuningAdvicesRequest
 * @return DescribeSQLTuningAdvicesResponse
 */
async function describeSQLTuningAdvices(request: DescribeSQLTuningAdvicesRequest): DescribeSQLTuningAdvicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLTuningAdvicesWithOptions(request, runtime);
}

model DescribeSampleSqlRawTextsRequest {
  dbName?: string(name='DbName', description='This parameter is required.', example='test_db'),
  dynamicSql?: boolean(name='DynamicSql'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2023-04-12T05:38:38Z'),
  instanceId?: string(name='InstanceId', example='ob317v4uif****'),
  limit?: string(name='Limit', example='20'),
  sqlId?: string(name='SqlId', description='SQL ID。

This parameter is required.', example='8D6E84****0B8FB1823D199E2CA1****'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2023-04-12T04:38:38Z'),
  tenantId?: string(name='TenantId', example='ob2mr3oae0****'),
  traceId?: string(name='TraceId', example='YB420A700EFB-00060D53E42D0C61-0-0'),
}

model DescribeSampleSqlRawTextsResponseBody = {
  data?: {
    sqlText?: [ string ](name='SqlText'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeSampleSqlRawTextsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSampleSqlRawTextsResponseBody(name='body'),
}

/**
 * @summary 查询采样SQL的原始文本
 *
 * @param request DescribeSampleSqlRawTextsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSampleSqlRawTextsResponse
 */
async function describeSampleSqlRawTextsWithOptions(request: DescribeSampleSqlRawTextsRequest, runtime: Util.RuntimeOptions): DescribeSampleSqlRawTextsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.dynamicSql)) {
    body['DynamicSql'] = request.dynamicSql;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.limit)) {
    body['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.sqlId)) {
    body['SqlId'] = request.sqlId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.traceId)) {
    body['TraceId'] = request.traceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSampleSqlRawTexts',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询采样SQL的原始文本
 *
 * @param request DescribeSampleSqlRawTextsRequest
 * @return DescribeSampleSqlRawTextsResponse
 */
async function describeSampleSqlRawTexts(request: DescribeSampleSqlRawTextsRequest): DescribeSampleSqlRawTextsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSampleSqlRawTextsWithOptions(request, runtime);
}

model DescribeSecurityIpGroupsRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='i-bp67acfmxazb4p****'),
}

model DescribeSecurityIpGroupsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  securityIpGroups?: [ 
    {
      securityIpGroupName?: string(name='SecurityIpGroupName', example='online_paycore'),
      securityIps?: string(name='SecurityIps', example='121.41.106.33,100.104.7.0/26'),
    }
  ](name='SecurityIpGroups'),
  totalCount?: int32(name='TotalCount', description='Example 1', example='2'),
}

model DescribeSecurityIpGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSecurityIpGroupsResponseBody(name='body'),
}

/**
 * @summary The name of the security group.
 *
 * @param request DescribeSecurityIpGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSecurityIpGroupsResponse
 */
async function describeSecurityIpGroupsWithOptions(request: DescribeSecurityIpGroupsRequest, runtime: Util.RuntimeOptions): DescribeSecurityIpGroupsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSecurityIpGroups',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The name of the security group.
 *
 * @param request DescribeSecurityIpGroupsRequest
 * @return DescribeSecurityIpGroupsResponse
 */
async function describeSecurityIpGroups(request: DescribeSecurityIpGroupsRequest): DescribeSecurityIpGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSecurityIpGroupsWithOptions(request, runtime);
}

model DescribeSessionListRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model DescribeSessionListResponseBody = {
  data?: [ 
    {
      host?: string(name='Host', description='The address of the client, with the format ip:port.', example='192.***.**.100:80'),
      sessionId?: string(name='SessionId', description='The session ID of the proxy service.', example='d2c90ad0-bc54-410f-bb89-2dcf14aa3c6d'),
    }
  ](name='Data', description='The object information.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeSessionListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSessionListResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query sessions between the ApsaraDB for OceanBase and the application.
 *
 * @param request DescribeSessionListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSessionListResponse
 */
async function describeSessionListWithOptions(request: DescribeSessionListRequest, runtime: Util.RuntimeOptions): DescribeSessionListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSessionList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query sessions between the ApsaraDB for OceanBase and the application.
 *
 * @param request DescribeSessionListRequest
 * @return DescribeSessionListResponse
 */
async function describeSessionList(request: DescribeSessionListRequest): DescribeSessionListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSessionListWithOptions(request, runtime);
}

model DescribeSlowSQLHistoryListRequest {
  endTime?: string(name='EndTime', description='The end time of the time range for querying the execution history of the slow SQL statement.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-12-14T08:34:49Z'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.    
- Start value: 1   
- Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of rows to return on each page.  
- Maximum value: 100   
- Default value: 10', example='10'),
  SQLId?: string(name='SQLId', description='The SQL ID, which uniquely identifies an SQL statement.

This parameter is required.', example='8D6E84735C0****1823D199E2CA1****'),
  startTime?: string(name='StartTime', description='The start time of the time range for querying the execution history of the slow SQL statement.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-12-14T02:34:49Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t384tolsj****'),
}

model DescribeSlowSQLHistoryListResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  slowSQLHistoryList?: {
    count?: long(name='Count', description='The quantity.', example='1'),
    list?: [ 
      {
        affectedRows?: double(name='AffectedRows', description='The number of rows affected.', example='0'),
        appWaitTime?: double(name='AppWaitTime', description='The wait time of the client.', example='0.0'),
        blockCacheHit?: double(name='BlockCacheHit', description='The number of block cache hits.', example='14'),
        blockIndexCacheHit?: double(name='BlockIndexCacheHit', description='The number of block index cache hits.', example='4'),
        bloomFilterCacheHit?: double(name='BloomFilterCacheHit', description='The number of Bloom filter cache hits.', example='0'),
        clientIp?: string(name='ClientIp', description='The IP address of the client.', example='1*2.***.1*3.***'),
        concurrencyWaitTime?: double(name='ConcurrencyWaitTime', description='The wait time in concurrent execution.', example='0.0'),
        cpuTime?: double(name='CpuTime', description='The average CPU time.', example='50.13'),
        dbName?: string(name='DbName', description='The name of the database.', example='testdb'),
        decodeTime?: double(name='DecodeTime', description='The time to wait for decoding.', example='0.0'),
        diskRead?: double(name='DiskRead', description='The number of physical reads.', example='0'),
        elapsedTime?: double(name='ElapsedTime', description='The average response time.', example='76.382'),
        endTimeUTCString?: string(name='EndTimeUTCString', description='The end time.', example='2021-12-28T02:08:18Z'),
        event?: string(name='Event', description='The wait event.', example='mysql response wait client'),
        execPerSecond?: double(name='ExecPerSecond', description='The number of executions per second.', example='163.0'),
        executeTime?: double(name='ExecuteTime', description='The internal execution time.', example='61.044'),
        executions?: double(name='Executions', description='The number of executions.', example='89403'),
        failTimes?: double(name='FailTimes', description='The number of failures.', example='0'),
        getPlanTime?: double(name='GetPlanTime', description='Hard parsing time.', example='0.052'),
        IOWaitTime?: double(name='IOWaitTime', description='The I/O wait time.', example='0.0'),
        logicalRead?: double(name='LogicalRead', description='The number of logical reads.', example='19'),
        maxCpuTime?: double(name='MaxCpuTime', description='The maximum CPU time.', example='257.967'),
        maxElapsedTime?: double(name='MaxElapsedTime', description='The maximum response time.', example='260.044'),
        memstoreReadRowCount?: double(name='MemstoreReadRowCount', description='The number of rows read from the memory.', example='527'),
        missPlans?: double(name='MissPlans', description='The number of plan misses.', example='0'),
        netWaitTime?: double(name='NetWaitTime', description='The wait time for network.', example='0.0'),
        nodeIp?: string(name='NodeIp', description='The IP address of the node.', example='i-bp18qljorblo8es*****'),
        queueTime?: double(name='QueueTime', description='The queuing time.', example='15.275'),
        RPCCount?: double(name='RPCCount', description='The number of RPCs.', example='0'),
        remotePlans?: double(name='RemotePlans', description='The number of remote plans.', example='0'),
        retryCount?: double(name='RetryCount', description='The number of retries.', example='0'),
        returnRows?: double(name='ReturnRows', description='The number of rows returned.', example='1'),
        rowCacheHit?: double(name='RowCacheHit', description='The number of row cache hits.', example='0'),
        scheduleTime?: double(name='ScheduleTime', description='The scheduling duration.', example='0.0'),
        sqlId?: string(name='SqlId', description='SQLID.', example='8D6E84****0B8FB1823D199E2CA1****'),
        sqlType?: string(name='SqlType', description='The SQL type.', example='1'),
        ssstoreReadRowCount?: double(name='SsstoreReadRowCount', description='The number of rows read from the disk.', example='43086'),
        tenantName?: string(name='TenantName', description='The name of the tenant.', example='pay_online'),
        totalWaitTime?: double(name='TotalWaitTime', description='The internal wait time.', example='10.966'),
        userName?: string(name='UserName', description='The username.', example='tester'),
      }
    ](name='List', description='The return result of the request.'),
  }(name='SlowSQLHistoryList', description='The execution history of the slow SQL statement.'),
}

model DescribeSlowSQLHistoryListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSlowSQLHistoryListResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the execution history of an SQL statement by SQL ID that is determined as a slow SQL statement during a specified period of time.
 *
 * @param request DescribeSlowSQLHistoryListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSlowSQLHistoryListResponse
 */
async function describeSlowSQLHistoryListWithOptions(request: DescribeSlowSQLHistoryListRequest, runtime: Util.RuntimeOptions): DescribeSlowSQLHistoryListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.SQLId)) {
    body['SQLId'] = request.SQLId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSlowSQLHistoryList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the execution history of an SQL statement by SQL ID that is determined as a slow SQL statement during a specified period of time.
 *
 * @param request DescribeSlowSQLHistoryListRequest
 * @return DescribeSlowSQLHistoryListResponse
 */
async function describeSlowSQLHistoryList(request: DescribeSlowSQLHistoryListRequest): DescribeSlowSQLHistoryListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSlowSQLHistoryListWithOptions(request, runtime);
}

model DescribeSlowSQLListRequest {
  dbName?: string(name='DbName', description='The name of the database.', example='testdb'),
  endTime?: string(name='EndTime', description='The end time of the time range for querying slow SQL statements.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-09-13T15:40:43Z'),
  filterCondition?: map[string]any(name='FilterCondition', description='The filter condition.', example='[dbName:sys]'),
  nodeIp?: string(name='NodeIp', description='The IP address of the database node.', example='i-bp18qljorblo8es*****'),
  pageNumber?: int32(name='PageNumber', description='The number of rows to return on each page.  
- Maximum value: 100  
- Default value: 10', example='10'),
  pageSize?: int32(name='PageSize', description='The number of the page to return.    
- Start value: 1   
- Default value: 1', example='1'),
  SQLId?: string(name='SQLId', description='The SQL ID, which uniquely identifies an SQL statement.', example='8D6E84****0B8FB1823D199E2CA1****'),
  searchKeyWord?: string(name='SearchKeyWord', description='The search keyword.', example='update'),
  searchParameter?: string(name='SearchParameter', description='The search parameter.', example='cputime'),
  searchRule?: string(name='SearchRule', description='The search rule.', example='>'),
  searchValue?: string(name='SearchValue', description='The search value.', example='0.01'),
  sortColumn?: string(name='SortColumn', description='The sorted column.', example='cputime'),
  sortOrder?: string(name='SortOrder', description='The sorting rule.', example='desc'),
  startTime?: string(name='StartTime', description='The start time of the time range for querying slow SQL statements.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-06-13T15:40:43Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeSlowSQLListShrinkRequest {
  dbName?: string(name='DbName', description='The name of the database.', example='testdb'),
  endTime?: string(name='EndTime', description='The end time of the time range for querying slow SQL statements.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-09-13T15:40:43Z'),
  filterConditionShrink?: string(name='FilterCondition', description='The filter condition.', example='[dbName:sys]'),
  nodeIp?: string(name='NodeIp', description='The IP address of the database node.', example='i-bp18qljorblo8es*****'),
  pageNumber?: int32(name='PageNumber', description='The number of rows to return on each page.  
- Maximum value: 100  
- Default value: 10', example='10'),
  pageSize?: int32(name='PageSize', description='The number of the page to return.    
- Start value: 1   
- Default value: 1', example='1'),
  SQLId?: string(name='SQLId', description='The SQL ID, which uniquely identifies an SQL statement.', example='8D6E84****0B8FB1823D199E2CA1****'),
  searchKeyWord?: string(name='SearchKeyWord', description='The search keyword.', example='update'),
  searchParameter?: string(name='SearchParameter', description='The search parameter.', example='cputime'),
  searchRule?: string(name='SearchRule', description='The search rule.', example='>'),
  searchValue?: string(name='SearchValue', description='The search value.', example='0.01'),
  sortColumn?: string(name='SortColumn', description='The sorted column.', example='cputime'),
  sortOrder?: string(name='SortOrder', description='The sorting rule.', example='desc'),
  startTime?: string(name='StartTime', description='The start time of the time range for querying slow SQL statements.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

This parameter is required.', example='2021-06-13T15:40:43Z'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeSlowSQLListResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  slowSQLList?: [ 
    {
      affectedRows?: long(name='AffectedRows', description='The number of rows affected.', example='0'),
      appWaitTime?: float(name='AppWaitTime', description='The wait time of the client.', example='0.0'),
      blockCacheHit?: long(name='BlockCacheHit', description='The number of block cache hits.', example='14'),
      blockIndexCacheHit?: long(name='BlockIndexCacheHit', description='The number of block index cache hits.', example='4'),
      bloomFilterCacheHit?: long(name='BloomFilterCacheHit', description='The number of Bloom filter cache hits.', example='0'),
      clientIp?: string(name='ClientIp', description='The IP address of the client.', example='1*2.***.1*3.***'),
      concurrencyWaitTime?: float(name='ConcurrencyWaitTime', description='The wait time in concurrent execution.', example='0.0'),
      cpuTime?: float(name='CpuTime', description='The average CPU time.', example='50.13'),
      dbName?: string(name='DbName', description='The name of the database.', example='testdb'),
      decodeTime?: float(name='DecodeTime', description='The time to wait for decoding.', example='0.0'),
      diskRead?: long(name='DiskRead', description='The number of physical reads.', example='0'),
      elapsedTime?: float(name='ElapsedTime', description='The average response time.', example='76.382'),
      event?: string(name='Event', description='The wait event.', example='mysql response wait client'),
      execPerSecond?: float(name='ExecPerSecond', description='The number of executions per second.', example='163.0'),
      executeTime?: float(name='ExecuteTime', description='The internal execution time.', example='61.044'),
      executions?: long(name='Executions', description='The number of executions.', example='89403'),
      failTimes?: long(name='FailTimes', description='The number of failures.', example='0'),
      getPlanTime?: float(name='GetPlanTime', description='The time spent in hard parsing.', example='0.052'),
      IOWaitTime?: float(name='IOWaitTime', description='The I/O wait time.', example='0.0'),
      key?: long(name='Key', description='The sequence number of the returned SQL statement.', example='1'),
      logicalRead?: long(name='LogicalRead', description='The number of logical reads.', example='19'),
      maxCpuTime?: float(name='MaxCpuTime', description='The maximum CPU time.', example='257.967'),
      maxElapsedTime?: float(name='MaxElapsedTime', description='The maximum response time.', example='260.044'),
      memstoreReadRowCount?: long(name='MemstoreReadRowCount', description='The number of rows read from the memory.', example='527'),
      missPlans?: long(name='MissPlans', description='The number of plan misses.', example='0'),
      netWaitTime?: float(name='NetWaitTime', description='The network latency.', example='0.0'),
      nodeIp?: string(name='NodeIp', description='The IP address of the node.', example='i-bp18qljorblo8es*****'),
      queueTime?: float(name='QueueTime', description='The queuing time.', example='15.275'),
      RPCCount?: long(name='RPCCount', description='The number of RPCs.', example='0'),
      remotePlans?: long(name='RemotePlans', description='The number of remote plans.', example='0'),
      retryCount?: long(name='RetryCount', description='The number of retries.', example='0'),
      returnRows?: long(name='ReturnRows', description='The number of rows returned.', example='1'),
      rowCacheHit?: long(name='RowCacheHit', description='The number of row cache hits.', example='0'),
      SQLId?: string(name='SQLId', description='SQLID.', example='8D6E84****0B8FB1823D199E2CA1****'),
      SQLText?: string(name='SQLText', description='The SQL text.', example='SELECT  ****   FROM ****   WHERE **** = ? AND **** = ?   ORDER BY **** ASC'),
      SQLType?: long(name='SQLType', description='The SQL type.', example='1'),
      scheduleTime?: float(name='ScheduleTime', description='The scheduling duration.', example='0.0'),
      ssstoreReadRowCount?: long(name='SsstoreReadRowCount', description='The number of rows read from the disk.', example='43086'),
      totalWaitTime?: float(name='TotalWaitTime', description='The internal wait time.', example='10.966'),
      userName?: string(name='UserName', description='The username.', example='tester'),
    }
  ](name='SlowSQLList', description='The list of slow SQL statements.'),
  totalCount?: long(name='TotalCount', description='The total count.', example='2'),
}

model DescribeSlowSQLListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSlowSQLListResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the list of slow SQL statements
 *
 * @param tmpReq DescribeSlowSQLListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSlowSQLListResponse
 */
async function describeSlowSQLListWithOptions(tmpReq: DescribeSlowSQLListRequest, runtime: Util.RuntimeOptions): DescribeSlowSQLListResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeSlowSQLListShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.filterCondition)) {
    request.filterConditionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterCondition, 'FilterCondition', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.filterConditionShrink)) {
    body['FilterCondition'] = request.filterConditionShrink;
  }
  if (!Util.isUnset(request.nodeIp)) {
    body['NodeIp'] = request.nodeIp;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.SQLId)) {
    body['SQLId'] = request.SQLId;
  }
  if (!Util.isUnset(request.searchKeyWord)) {
    body['SearchKeyWord'] = request.searchKeyWord;
  }
  if (!Util.isUnset(request.searchParameter)) {
    body['SearchParameter'] = request.searchParameter;
  }
  if (!Util.isUnset(request.searchRule)) {
    body['SearchRule'] = request.searchRule;
  }
  if (!Util.isUnset(request.searchValue)) {
    body['SearchValue'] = request.searchValue;
  }
  if (!Util.isUnset(request.sortColumn)) {
    body['SortColumn'] = request.sortColumn;
  }
  if (!Util.isUnset(request.sortOrder)) {
    body['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSlowSQLList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the list of slow SQL statements
 *
 * @param request DescribeSlowSQLListRequest
 * @return DescribeSlowSQLListResponse
 */
async function describeSlowSQLList(request: DescribeSlowSQLListRequest): DescribeSlowSQLListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSlowSQLListWithOptions(request, runtime);
}

model DescribeSqlAuditStatRequest {
  endTime?: string(name='EndTime', example='2025-01-14T03:34:49Z'),
  instanceId?: string(name='InstanceId', example='ob317v4uif****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='1'),
  startTime?: string(name='StartTime', example='2025-01-14T02:34:49Z'),
  tenantId?: string(name='TenantId', example='t33h8y08k****'),
}

model DescribeSqlAuditStatResponseBody = {
  data?: [ 
    {
      affectRows?: double(name='AffectRows', example='1'),
      databaseName?: string(name='DatabaseName', example='test_database_1'),
      executeTime?: double(name='ExecuteTime', example='142'),
      instanceId?: string(name='InstanceId', example='ob317v4uif****'),
      operatorType?: string(name='OperatorType', example='UPDATE'),
      returnRows?: double(name='ReturnRows', example='1'),
      scanRows?: double(name='ScanRows', example='1'),
      sqlId?: string(name='SqlId', description='Sql ID', example='8D6E84****0B8FB1823D199E2CA1****'),
      sqlStatement?: string(name='SqlStatement', example='UPDATE `oceanbase_test_table` SET `name` = ? WHERE `key` = ?'),
      tenantId?: string(name='TenantId', example='t33h8y08k****'),
      totalAffectRows?: long(name='TotalAffectRows', example='1'),
      totalFailed?: long(name='TotalFailed', example='0'),
      totalReturnRows?: long(name='TotalReturnRows', example='1'),
      totalScanRows?: long(name='TotalScanRows', example='10'),
      totalSucceed?: long(name='TotalSucceed', example='1'),
      userClientIp?: string(name='UserClientIp', example='xx.xx.xx.xx'),
      userName?: string(name='UserName', example='test_mysql'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', description='Id of the request', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model DescribeSqlAuditStatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSqlAuditStatResponseBody(name='body'),
}

/**
 * @summary 按照客户端IP、用户、SQLID的维度统计SQL数据执行情况
 *
 * @param request DescribeSqlAuditStatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSqlAuditStatResponse
 */
async function describeSqlAuditStatWithOptions(request: DescribeSqlAuditStatRequest, runtime: Util.RuntimeOptions): DescribeSqlAuditStatResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSqlAuditStat',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 按照客户端IP、用户、SQLID的维度统计SQL数据执行情况
 *
 * @param request DescribeSqlAuditStatRequest
 * @return DescribeSqlAuditStatResponse
 */
async function describeSqlAuditStat(request: DescribeSqlAuditStatRequest): DescribeSqlAuditStatResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSqlAuditStatWithOptions(request, runtime);
}

model DescribeStandbyCreateModeRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob4wibn0abo9uo'),
  tenantId?: string(name='TenantId', description='This parameter is required.', example='txxxxxxx'),
}

model DescribeStandbyCreateModeResponseBody = {
  data?: {
    createMode?: string(name='CreateMode', example='BACKUP_RESTORE'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model DescribeStandbyCreateModeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeStandbyCreateModeResponseBody(name='body'),
}

/**
 * @summary DescribeStandbyCreateMode
 *
 * @param request DescribeStandbyCreateModeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeStandbyCreateModeResponse
 */
async function describeStandbyCreateModeWithOptions(request: DescribeStandbyCreateModeRequest, runtime: Util.RuntimeOptions): DescribeStandbyCreateModeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeStandbyCreateMode',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary DescribeStandbyCreateMode
 *
 * @param request DescribeStandbyCreateModeRequest
 * @return DescribeStandbyCreateModeResponse
 */
async function describeStandbyCreateMode(request: DescribeStandbyCreateModeRequest): DescribeStandbyCreateModeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeStandbyCreateModeWithOptions(request, runtime);
}

model DescribeTagValuesRequest {
  resourceType?: string(name='ResourceType', description='The type of the resource.

This parameter is required.', example='tag'),
}

model DescribeTagValuesResponseBody = {
  map?: string(name='Map', description='The mappings between tag groups and tags.', example='"{\\\\"Tag group 2\\\\":[\\\\"Tag 2-1\\\\",\\\\"Tag 2-2\\\\"],\\\\"Tag group 1\\\\":[\\\\"Tag 1-1\\\\"]}"'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4C91F7BA-xxxx-xxxx-xxxx-846ECA1A9908'),
}

model DescribeTagValuesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTagValuesResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query tags.
 *
 * @param request DescribeTagValuesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTagValuesResponse
 */
async function describeTagValuesWithOptions(request: DescribeTagValuesRequest, runtime: Util.RuntimeOptions): DescribeTagValuesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTagValues',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query tags.
 *
 * @param request DescribeTagValuesRequest
 * @return DescribeTagValuesResponse
 */
async function describeTagValues(request: DescribeTagValuesRequest): DescribeTagValuesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTagValuesWithOptions(request, runtime);
}

model DescribeTenantRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='ob2mr3oae0****'),
}

model DescribeTenantResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenant?: {
    availableZones?: [ string ](name='AvailableZones', description='The list of zones.'),
    charset?: string(name='Charset', description='The character set.', example='utf8mb4'),
    clogServiceStatus?: string(name='ClogServiceStatus', description='The enabling status of the clog service.  
- CLOSED: The clog service is disabled.  
- ONLINE: The clog service is running.', example='CLOSED'),
    collation?: string(name='Collation', description='The collation.', example='utf8mb4_general_ci'),
    createTime?: string(name='CreateTime', description='The time when the tenant was created.', example='2023-04-21 11:15:47.0'),
    dataMergeTime?: string(name='DataMergeTime', description='The major compaction time of the tenant. This parameter is supported only in OceanBase Database V4.0.0 and later.', example='02:36Z'),
    deployMode?: string(name='DeployMode', description='The data replica distribution mode of the tenant.    

- For the high availability version, N-N-N indicates the three-zone mode, and N-N indicates the dual-zone or single-zone mode.
- For the basic version, N indicates the single-zone mode. 

> <br>N represents the number of nodes in a single zone.', example='1-1-1'),
    deployType?: string(name='DeployType', description='The deployment type of the cluster. Valid values:  
- multiple: multi-IDC deployment   
- single: single-IDC deployment   
- dual: dual-IDC deployment', example='multiple'),
    description?: string(name='Description', description='The description of the tenant.', example='paycore database'),
    diskType?: string(name='DiskType', description='The type of the disk.', example='cloud_essd_pl1'),
    enableBinlogService?: boolean(name='EnableBinlogService', description='Indicates whether the binlog service is available for application.', example='true'),
    enableClogService?: boolean(name='EnableClogService', description='Indicates whether the clog service is available. To enable the clog service, submit a ticket.', example='false'),
    enableInternetAddressService?: boolean(name='EnableInternetAddressService', description='Indicates whether the Internet address can be enabled for the tenant.', example='true'),
    enableParallelQuery?: boolean(name='EnableParallelQuery', description='Indicates whether parallel query can be enabled.', example='true'),
    enableReadOnlyReplica?: boolean(name='EnableReadOnlyReplica', description='Indicates whether read-only replicas are supported.', example='true'),
    enableReadWriteSplit?: boolean(name='EnableReadWriteSplit', description='Indicates whether to enable read/write splitting endpoint.', example='false'),
    instanceType?: string(name='InstanceType', description='The type of the instance.', example='KAFKA_PUBLIC'),
    lowerCaseTableNames?: int32(name='LowerCaseTableNames', description='Indicates whether the table name is case-sensitive. Valid values: 
* **1**: The table name is case-insensitive. 
* **0**: The table name is case-sensitive.', example='1'),
    masterIntranetAddressZone?: string(name='MasterIntranetAddressZone', description='The zone where the primary node is located.', example='cn-hangzhou-h'),
    maxParallelQueryDegree?: long(name='MaxParallelQueryDegree', description='The maximum value of DOP.', example='32'),
    odpVersion?: string(name='OdpVersion', description='The ODP version.', example='4.3.1-xxxxxxxxx'),
    parameterTemplate?: string(name='ParameterTemplate', description='The parameter template.', example='express_oltp'),
    payType?: string(name='PayType', description='The type of the payment.', example='POSTPAY'),
    primaryZone?: string(name='PrimaryZone', description='The primary zone of the tenant.', example='cn-hangzhou-h'),
    primaryZoneDeployType?: string(name='PrimaryZoneDeployType', description='The deployment type of the primary zone.', example='RANDOM'),
    readOnlyResource?: {
      capacityUnit?: {
        maxCapacityUnit?: int32(name='MaxCapacityUnit', description='The maximum number of capacity units.', example='16'),
        minCapacityUnit?: int32(name='MinCapacityUnit', description='The minimum number of capacity units.', example='1'),
        usedCapacit?: int32(name='UsedCapacit', description='The number of used capacity units.', example='5'),
      }(name='CapacityUnit', description='The information about capacity units.'),
      cpu?: {
        totalCpu?: float(name='TotalCpu', description='The total number of CPU cores of the tenant.', example='10'),
        unitCpu?: float(name='UnitCpu', description='The number of CPU cores in each resource unit of the tenant.', example='8'),
        usedCpu?: float(name='UsedCpu', description='The number of CPU cores used by the cluster.', example='8'),
      }(name='Cpu', description='The number of CPU cores of each replica node in the cluster.'),
      diskSize?: {
        usedDiskSize?: float(name='UsedDiskSize', description='The size of disk space used by the tenant, in GB.', example='86'),
      }(name='DiskSize', description='The size of the data disk.'),
      logDiskSize?: {
        totalLogDisk?: int32(name='TotalLogDisk', description='The total log disk size of the tenant, in GB.', example='8.0'),
        unitLogDisk?: int32(name='UnitLogDisk', description='The log disk size of each resource unit of the tenant, in GB.', example='8.0'),
      }(name='LogDiskSize', description='The information about the log disk resources of the tenant.'),
      memory?: {
        totalMemory?: float(name='TotalMemory', description='The total memory size of the tenant, in GB.', example='64'),
        unitMemory?: float(name='UnitMemory', description='The memory size of each resource unit of the tenant, in GB.', example='32'),
        usedMemory?: float(name='UsedMemory', description='The size of memory used by the tenant, in GB.', example='30'),
      }(name='Memory', description='The information about the memory resources of the cluster.'),
      unitNum?: int32(name='UnitNum', description='The number of resource units in the tenant.', example='2'),
    }(name='ReadOnlyResource', description='The information about read-only resources.'),
    recycleBinStatus?: string(name='RecycleBinStatus', description='The status of the recycle bin in the tenant. Valid values: 
* ON: The recycly bin is enabled. 
* OFF: The recycle bin is disabled.', example='ON'),
    series?: string(name='Series', description='The series of the instance.', example='normal'),
    status?: string(name='Status', description='The status of the tenant.

- ONLINE: The tenant is running.

- PENDING_CREATE: The tenant is being created.

- WAITING_ALLOCATE_MASTER_ADDRESS: The standby cluster is waiting for the primary address to be created.

- ALLOCATING_MASTER_ADDRESS: The primary address is being created.

- DELETING_MASTER_ADDRESS: The primary address is being deleted.

- ALLOCATING_INTERNET_ADDRESS: The Internet address is being created.

- PENDING_OFFLINE_INTERNET_ADDRESS: The Internet address is being deleted.

- ALLOCATING_READONLY_ADDRESS: The read-only address is being created.

- DELETING_READONLY_ADDRESS: The read-only address is being deleted.

- ALLOCATING_READWRITE_ADDRESS: The read/write splitting address is being created.

- DELETING_READWRITE_ADDRESS: The read/write splitting address is being deleted.

- ALLOCATING_CLOGSERVICE_ADDRESS: The clog address is being created.

- DELETING_CLOGSERVICE_ADDRESS: The clog address is being deleted.

- MODIFYING_ADDRESS: The domain name of the address is being modified.

- MODIFYING_PRIMARY_ZONE: The primary zone is being switched.

- MODIFYING_READONLY_ADDRESS: The read-only address is being modified.

- MODIFYING_READWRITE_ADDRESS: The read/write splitting address is being modified.

- SPEC_MODIFYING: The specifications of the tenant are being modified.

- WHITE_LIST_MODIFYING: The allowlist is being modified.

- CREATING_BINLOG: Binlogs are being created.', example='ONLINE'),
    tenantConnections?: [ 
      {
        addressType?: string(name='AddressType', description='The type of the address.

- MASTER: the primary address, which supports both data read and write.
- READONLY: a read-only address.
- READWRITE: a read/write splitting address.
- CLOGSERVICE: a clog service address.', example='READONLY'),
        connectionLogicalZones?: [ string ](name='ConnectionLogicalZones', description='The logical zones of the endpoints.'),
        connectionReplicaType?: string(name='ConnectionReplicaType', description='The type of the replica corresponding to the tenant connection.', example='FULL'),
        connectionZones?: [ string ](name='ConnectionZones', description='The list of zones corresponding to the tenant connection.', example='["cn-hangzhou-i", "cn-hangzhou-j"]'),
        enableTransactionSplit?: boolean(name='EnableTransactionSplit', description='Specifies whether to enable transaction splitting.', example='false'),
        internetAddress?: string(name='InternetAddress', description='The Internet address for accessing the tenant.', example='t32a7ru5u****mo.oceanbase.aliyuncs.com'),
        internetAddressStatus?: string(name='InternetAddressStatus', description='The status of the Internet address for accessing the tenant. Valid values:   
- CLOSED: The address is disabled.   
- ALLOCATING_INTERNET_ADDRESS: An address is being applied for.   
- PENDING_OFFLINE_INTERNET_ADDRESS: The address is being disabled.   
- ONLINE: The address is in service.', example='CLOSED'),
        internetMaxConnectionLimit?: long(name='InternetMaxConnectionLimit', description='The upper limit of the maximum number of public connections.', example='4000'),
        internetMaxConnectionNum?: long(name='InternetMaxConnectionNum', description='The current value set for the maximum number of public connections.', example='2500'),
        internetPort?: int32(name='InternetPort', description='The Internet port for accessing the tenant.', example='3306'),
        internetRpcPort?: int32(name='InternetRpcPort', description='The port for direct loads of public connections.', example='3307'),
        intranetAddress?: string(name='IntranetAddress', description='The intranet address for accessing the tenant.', example='t4nunwxr0****.oceanbase.aliyuncs.com'),
        intranetAddressMasterZoneId?: string(name='IntranetAddressMasterZoneId', description='The primary zone corresponding to the address for accessing the tenant.', example='cn-hangzhou-b'),
        intranetAddressSlaveZoneId?: string(name='IntranetAddressSlaveZoneId', description='The standby zone corresponding to the address for accessing the tenant.', example='cn-hangzhou-g'),
        intranetAddressStatus?: string(name='IntranetAddressStatus', description='The status of the intranet address for accessing the tenant.  
The value ONLINE indicates that the address is in service.', example='ONLINE'),
        intranetPort?: int32(name='IntranetPort', description='The intranet port for accessing the tenant.', example='2983'),
        intranetRpcPort?: int32(name='IntranetRpcPort', description='The port for direct loads of private connections.', example='3307'),
        intranetSqlPort?: int32(name='IntranetSqlPort', description='The port of private SQL connections.', example='3306'),
        maxConnectionLimit?: long(name='MaxConnectionLimit', description='The current value set for the maximum number of private connections.', example='1000'),
        maxConnectionNum?: long(name='MaxConnectionNum', description='The maximum number of connections.', example='5000'),
        odpVersion?: string(name='OdpVersion', description='The ODP version.', example='4.3.1-xxxxxxxxx'),
        parallelQueryDegree?: long(name='ParallelQueryDegree', description='The degree of parallelism (DOP).', example='1'),
        proxyClusterId?: string(name='ProxyClusterId', description='The ID of the OceanBase Database Proxy (ODP) cluster.', example='proxy-xxxxxxx'),
        tenantEndpointId?: string(name='TenantEndpointId', description='The ID of the tenant endpoint.', example='obe-4tw51gp7****'),
        transactionSplit?: boolean(name='TransactionSplit', description='Specifies whether to enable transaction splitting.', example='false'),
        vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-bp1i7b94u2et716yl****'),
        vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-bp1qiail1asmfe23t****'),
      }
    ](name='TenantConnections', description='The connection information of the tenant.'),
    tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t4louaeei****'),
    tenantMaxConnections?: string(name='TenantMaxConnections', description='The maximum number of connections allowed in the tenant.', example='1600'),
    tenantMode?: string(name='TenantMode', description='The mode of the tenant.
Valid values:
- Oracle   
- MySQL', example='MySQL'),
    tenantName?: string(name='TenantName', description='The name of the tenant.', example='forMySQLTenant'),
    tenantResource?: {
      capacityUnit?: {
        maxCapacityUnit?: int32(name='MaxCapacityUnit', description='The maximum number of capacity units.', example='16'),
        minCapacityUnit?: int32(name='MinCapacityUnit', description='The minimum number of capacity units.', example='1'),
        usedCapacit?: int32(name='UsedCapacit', description='The number of used capacity units.', example='5'),
      }(name='CapacityUnit', description='The information about capacity units.'),
      cpu?: {
        totalCpu?: float(name='TotalCpu', description='The total number of CPU cores of the tenant.', example='10'),
        unitCpu?: float(name='UnitCpu', description='The number of CPU cores in each resource unit of the tenant.', example='8'),
        usedCpu?: float(name='UsedCpu', description='The number of used CPU cores of the tenant.', example='8'),
      }(name='Cpu', description='The information about the CPU resources of the tenant.'),
      diskSize?: {
        usedDiskSize?: float(name='UsedDiskSize', description='The size of used disk space of the tenant, in GB.', example='86'),
      }(name='DiskSize', description='The information about the disk resources of the tenant.'),
      logDiskSize?: {
        totalLogDisk?: int32(name='TotalLogDisk', description='The total size of log disk of the tenant, in GB.', example='8.0'),
        unitLogDisk?: int32(name='UnitLogDisk', description='The log disk size of each resource unit of the tenant, in GB.', example='8.0'),
      }(name='LogDiskSize', description='The information about the log disk resources of the tenant.'),
      memory?: {
        totalMemory?: float(name='TotalMemory', description='The total memory size of the tenant, in GB.', example='64'),
        unitMemory?: float(name='UnitMemory', description='The memory size of each resource unit of the tenant, in GB.', example='32'),
        usedMemory?: float(name='UsedMemory', description='The size of used memory of the tenant, in GB.', example='30'),
      }(name='Memory', description='The information about the memory resources of the tenant.'),
      unitNum?: int32(name='UnitNum', description='The number of resource units for the tenant.', example='1'),
    }(name='TenantResource', description='The resource information of the tenant.'),
    tenantZones?: [ 
      {
        region?: string(name='Region', description='The region where the zone of the tenant resides.', example='cn-hangzhou'),
        tenantZoneId?: string(name='TenantZoneId', description='The ID of the zone.', example='cn-hangzhou-h'),
        tenantZoneReplicas?: [ 
          {
            fullCopyId?: int32(name='FullCopyId', description='The ID of the full-featured replica.', example='3'),
            logicZoneName?: string(name='LogicZoneName', description='The name of the logical zone.', example='cn-shanghai-f-z0'),
            readOnlyCopyId?: string(name='ReadOnlyCopyId', description='The ID of the read-only replica.', example='3'),
            readOnlyReplicaType?: string(name='ReadOnlyReplicaType', description='The type of the read-only replica.', example='ROW_STORE'),
            zoneCopyId?: int32(name='ZoneCopyId', description='The ID of the zone replica.', example='2'),
            zoneNodes?: long(name='ZoneNodes', description='The number of nodes in the zone.', example='1'),
            zoneReplicaType?: string(name='ZoneReplicaType', description='The type of the zone replica.', example='FULL'),
          }
        ](name='TenantZoneReplicas', description='The zone replicas of the tenant.'),
        tenantZoneRole?: string(name='TenantZoneRole', description='The role of the zone of the tenant.', example='ReadWrite'),
      }
    ](name='TenantZones', description='The information about zones in the tenant.'),
    timeZone?: string(name='TimeZone', description='The time zone.', example='Asia/Shanghai'),
    version?: string(name='Version', description='The version information.', example='4.2.1'),
    vpcId?: string(name='VpcId', description='The Virtual Private Cloud (VPC) ID of the tenant. If no suitable VPC is available, create a VPC as prompted. For more information, see "What is a VPC".', example='vpc-bp1d2q3mhg9i23ofi****'),
  }(name='Tenant', description='The information about the tenant.'),
}

model DescribeTenantResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the information of a specific tenant in a specific cluster.
 *
 * @param request DescribeTenantRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantResponse
 */
async function describeTenantWithOptions(request: DescribeTenantRequest, runtime: Util.RuntimeOptions): DescribeTenantResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenant',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the information of a specific tenant in a specific cluster.
 *
 * @param request DescribeTenantRequest
 * @return DescribeTenantResponse
 */
async function describeTenant(request: DescribeTenantRequest): DescribeTenantResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantWithOptions(request, runtime);
}

model DescribeTenantEncryptionRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob317v4uif****'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='10'),
  tenantId?: string(name='TenantId', example='t4louaeei****'),
  tenantName?: string(name='TenantName', example='forMySQLTenant'),
}

model DescribeTenantEncryptionResponseBody = {
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenantEncryptions?: [ 
    {
      enableEncryption?: boolean(name='EnableEncryption', example='false'),
      encryptionKeyId?: string(name='EncryptionKeyId', example='xxx'),
      encryptionType?: string(name='EncryptionType', example='INTERNAL'),
      status?: string(name='Status', example='OPEN'),
      tenantId?: string(name='TenantId', example='t4louaeei****'),
      tenantMode?: string(name='TenantMode', example='MySQL'),
      tenantName?: string(name='TenantName', example='forMySQLTenant'),
      tenantStatus?: string(name='TenantStatus', example='ONLINE'),
    }
  ](name='TenantEncryptions'),
  totalCount?: int32(name='TotalCount', example='8'),
}

model DescribeTenantEncryptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantEncryptionResponseBody(name='body'),
}

/**
 * @summary 查询租户加密信息
 *
 * @param request DescribeTenantEncryptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantEncryptionResponse
 */
async function describeTenantEncryptionWithOptions(request: DescribeTenantEncryptionRequest, runtime: Util.RuntimeOptions): DescribeTenantEncryptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.tenantName)) {
    body['TenantName'] = request.tenantName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenantEncryption',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询租户加密信息
 *
 * @param request DescribeTenantEncryptionRequest
 * @return DescribeTenantEncryptionResponse
 */
async function describeTenantEncryption(request: DescribeTenantEncryptionRequest): DescribeTenantEncryptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantEncryptionWithOptions(request, runtime);
}

model DescribeTenantMetricsRequest {
  endTime?: string(name='EndTime', description='This parameter is required.', example='2021-06-13T15:45:43Z'),
  instanceId?: string(name='InstanceId', description='2021-06-13T15:40:43Z

This parameter is required.', example='ob317v4uif****'),
  metrics?: string(name='Metrics', description='{"name":"DescribeTenantMetrics","product":"OceanBasePro","version":"2019-09-01","path":"/","deprecated":0,"method":"POST|GET","protocol":"HTTP|HTTPS","hidden":0,"timeout":10000,"parameter_type":"Single","params":"[{\\\\"name\\\\":\\\\"Action\\\\",\\\\"position\\\\":\\\\"Query\\\\",\\\\"required\\\\":true,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"DescribeTenantMetrics\\\\"},{\\\\"name\\\\":\\\\"InstanceId\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":true,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"ob317v4uif****\\\\"},{\\\\"name\\\\":\\\\"PageSize\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"Integer\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"10\\\\"},{\\\\"name\\\\":\\\\"PageNumber\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"Integer\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"1\\\\"},{\\\\"name\\\\":\\\\"TenantName\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":true,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"pay_online\\\\"},{\\\\"name\\\\":\\\\"StartTime\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":true,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"2021-06-13T15:40:43Z\\\\"},{\\\\"name\\\\":\\\\"EndTime\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":true,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"2021-06-13T15:45:43Z\\\\"},{\\\\"name\\\\":\\\\"Metrics\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":true,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"tps\\\\"},{\\\\"name\\\\":\\\\"TenantId\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":true,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"tfafd34fs****\\\\"},{\\\\"name\\\\":\\\\"TenantIdList\\\\",\\\\"position\\\\":\\\\"Body\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"[tdak3nac****,tdakc42df****]\\\\"}]","response_headers":"[]","response":"{\\\\"type\\\\":\\\\"Object\\\\",\\\\"children\\\\":[{\\\\"name\\\\":\\\\"TotalCount\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"Integer\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"9\\\\"},{\\\\"name\\\\":\\\\"RequestId\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C\\\\"},{\\\\"name\\\\":\\\\"TenantMetrics\\\\",\\\\"required\\\\":false,\\\\"checkBlank\\\\":false,\\\\"visibility\\\\":\\\\"Public\\\\",\\\\"deprecated\\\\":false,\\\\"type\\\\":\\\\"String\\\\",\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\",\\\\"example\\\\":\\\\"\\\\\\\\\\\\"Metrics\\\\\\\\\\\\":[ {\\\\\\\\\\\\"request_queue_rt\\\\\\\\\\\\":0.0,\\\\\\\\\\\\"TimeStamp\\\\\\\\\\\\":\\\\\\\\\\\\"2022-02-23T01:58:00Z\\\\\\\\\\\\"}]\\\\"}],\\\\"title\\\\":\\\\"\\\\",\\\\"description\\\\":\\\\"\\\\"}","errors":"{}"}

This parameter is required.', example='tps'),
  pageNumber?: int32(name='PageNumber', description='The ID of the OceanBase cluster.', example='1'),
  pageSize?: int32(name='PageSize', description='tfafd34fs****', example='10'),
  startTime?: string(name='StartTime', description='Example 1

This parameter is required.', example='2021-06-13T15:40:43Z'),
  tenantId?: string(name='TenantId', example='tfafd34fs****', deprecated=true),
  tenantIdList?: string(name='TenantIdList', example='[tdak3nac****,tdakc42df****]'),
  tenantName?: string(name='TenantName', description='2021-06-13T15:45:43Z', example='pay_online', deprecated=true),
}

model DescribeTenantMetricsResponseBody = {
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenantMetrics?: string(name='TenantMetrics', example='"Metrics":[ {"request_queue_rt":0.0,"TimeStamp":"2022-02-23T01:58:00Z"}]'),
  totalCount?: int32(name='TotalCount', example='9'),
}

model DescribeTenantMetricsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantMetricsResponseBody(name='body'),
}

/**
 * @summary The list of tenant IDs.
 *
 * @param request DescribeTenantMetricsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantMetricsResponse
 */
async function describeTenantMetricsWithOptions(request: DescribeTenantMetricsRequest, runtime: Util.RuntimeOptions): DescribeTenantMetricsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.metrics)) {
    body['Metrics'] = request.metrics;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.tenantIdList)) {
    body['TenantIdList'] = request.tenantIdList;
  }
  if (!Util.isUnset(request.tenantName)) {
    body['TenantName'] = request.tenantName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenantMetrics',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The list of tenant IDs.
 *
 * @param request DescribeTenantMetricsRequest
 * @return DescribeTenantMetricsResponse
 */
async function describeTenantMetrics(request: DescribeTenantMetricsRequest): DescribeTenantMetricsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantMetricsWithOptions(request, runtime);
}

model DescribeTenantReadableScnRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t33h8y08k****'),
}

model DescribeTenantReadableScnResponseBody = {
  data?: {
    readableScn?: long(name='ReadableScn', description='The maximum readable timestamp.', example='1715329164977'),
  }(name='Data', description='The data in the return result of the request.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='8442BB1E-3171-1192-B9DC-F6F4E53B2673'),
}

model DescribeTenantReadableScnResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantReadableScnResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the maximum readable timestamp of a tenant.
 *
 * @param request DescribeTenantReadableScnRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantReadableScnResponse
 */
async function describeTenantReadableScnWithOptions(request: DescribeTenantReadableScnRequest, runtime: Util.RuntimeOptions): DescribeTenantReadableScnResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenantReadableScn',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the maximum readable timestamp of a tenant.
 *
 * @param request DescribeTenantReadableScnRequest
 * @return DescribeTenantReadableScnResponse
 */
async function describeTenantReadableScn(request: DescribeTenantReadableScnRequest): DescribeTenantReadableScnResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantReadableScnWithOptions(request, runtime);
}

model DescribeTenantSecurityConfigsRequest {
  checkId?: string(name='CheckId', description='The unique identifier of the security check.', example='****'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t4louaeei****'),
}

model DescribeTenantSecurityConfigsResponseBody = {
  configs?: {
    checkId?: string(name='CheckId', description='The unique identifier of the check.', example='xxx'),
    checkTime?: string(name='CheckTime', description='The time when the check was performed.', example='2023-08-07 15:30:00'),
    instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
    tenantSecurityConfigs?: [ 
      {
        riskCount?: int32(name='RiskCount', description='The number of detected tenant security risks.', example='0'),
        securityConfigs?: [ 
          {
            configDescription?: string(name='ConfigDescription', description='The name of the check item.', example='Check whether the scope of the cluster allowlist is too big'),
            configGroup?: string(name='ConfigGroup', description='The group of the risk.', example='WHITELIST'),
            configName?: string(name='ConfigName', description='The name of the risk.', example='WHITELIST_RANGE_LARGE'),
            risk?: boolean(name='Risk', description='Indicates whether the risk causes security issues.', example='true'),
            riskDescription?: string(name='RiskDescription', description='The description of the risk.', example='The scope of the allowlist is too big.'),
          }
        ](name='SecurityConfigs', description='The list of risks.'),
        tenantId?: string(name='TenantId', description='The ID of the tenant.', example='xxx'),
        tenantName?: string(name='TenantName', description='The name of the tenant.', example='xxx'),
      }
    ](name='TenantSecurityConfigs', description='The check result.'),
    totalCheckCount?: int32(name='TotalCheckCount', description='The total number of security check items.', example='4'),
    totalRiskCount?: int32(name='TotalRiskCount', description='The total number of detected security risks.', example='0'),
  }(name='Configs', description='The list of parameters.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='523E7183-****-590D-****-12DFD316614B'),
}

model DescribeTenantSecurityConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantSecurityConfigsResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query security check items of an OceanBase Database tenant.
 *
 * @param request DescribeTenantSecurityConfigsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantSecurityConfigsResponse
 */
async function describeTenantSecurityConfigsWithOptions(request: DescribeTenantSecurityConfigsRequest, runtime: Util.RuntimeOptions): DescribeTenantSecurityConfigsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.checkId)) {
    body['CheckId'] = request.checkId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenantSecurityConfigs',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query security check items of an OceanBase Database tenant.
 *
 * @param request DescribeTenantSecurityConfigsRequest
 * @return DescribeTenantSecurityConfigsResponse
 */
async function describeTenantSecurityConfigs(request: DescribeTenantSecurityConfigsRequest): DescribeTenantSecurityConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantSecurityConfigsWithOptions(request, runtime);
}

model DescribeTenantSecurityIpGroupsRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model DescribeTenantSecurityIpGroupsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='473469**-AA6F-4D**-B3DB-A***********'),
  securityIpGroups?: [ 
    {
      securityIpGroupName?: string(name='SecurityIpGroupName', description='The group name.', example='test1'),
      securityIpGroupType?: string(name='SecurityIpGroupType', description='The whitelist group type.
- instance: the whitelist group from the cluster.
- tenant: the whitelist group of the current tenant.', example='tenant'),
      securityIps?: string(name='SecurityIps', description='The whitelist of IP addresses. It is a string separated by commas, and each object is an IP string or a CIDR block.', example='192.***.*.*"'),
      tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t4louaeei****'),
    }
  ](name='SecurityIpGroups', description='The list of the whitelist groups.'),
  totalCount?: int32(name='TotalCount', description='The total number of the whitelist groups.', example='2'),
}

model DescribeTenantSecurityIpGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantSecurityIpGroupsResponseBody(name='body'),
}

/**
 * @summary You can call this operation to view the list of whitelist groups of the tenant.
 *
 * @param request DescribeTenantSecurityIpGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantSecurityIpGroupsResponse
 */
async function describeTenantSecurityIpGroupsWithOptions(request: DescribeTenantSecurityIpGroupsRequest, runtime: Util.RuntimeOptions): DescribeTenantSecurityIpGroupsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenantSecurityIpGroups',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to view the list of whitelist groups of the tenant.
 *
 * @param request DescribeTenantSecurityIpGroupsRequest
 * @return DescribeTenantSecurityIpGroupsResponse
 */
async function describeTenantSecurityIpGroups(request: DescribeTenantSecurityIpGroupsRequest): DescribeTenantSecurityIpGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantSecurityIpGroupsWithOptions(request, runtime);
}

model DescribeTenantTagsRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tags?: string(name='Tags', description='The tags.', example='[{"Key": "xxx", "Value", "xxx"}]'),
  tenantIds?: string(name='TenantIds', description='The JSON string of the tenant ID.

This parameter is required.', example='["t5r0x2f6q****", "t33h8y08k****", "t5r41rtl7****"]'),
}

model DescribeTenantTagsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tagResources?: [ 
    {
      resourceId?: string(name='ResourceId', description='The ID of the resource.', example='ob317v4uif****'),
      resourceType?: string(name='ResourceType', description='The type of the resource.', example='instance'),
      tag?: string(name='Tag', description='The tag of the resource.', example='[{"Key": "xxx", "Value", "xxx"},{}]'),
    }
  ](name='TagResources', description='The list of tags.'),
}

model DescribeTenantTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantTagsResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the tags of tenants in a cluster.
 *
 * @param request DescribeTenantTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantTagsResponse
 */
async function describeTenantTagsWithOptions(request: DescribeTenantTagsRequest, runtime: Util.RuntimeOptions): DescribeTenantTagsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tags)) {
    body['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.tenantIds)) {
    body['TenantIds'] = request.tenantIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenantTags',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the tags of tenants in a cluster.
 *
 * @param request DescribeTenantTagsRequest
 * @return DescribeTenantTagsResponse
 */
async function describeTenantTags(request: DescribeTenantTagsRequest): DescribeTenantTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantTagsWithOptions(request, runtime);
}

model DescribeTenantUserRolesRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant. If you specify the ID of a tenant in MySQL mode, the privilege configuration of the regular user in MySQL mode is returned. If you specify the ID of a tenant in Oracle mode, the privilege configuration of the regular user in Oracle mode is returned.', example='t4pnum****'),
}

model DescribeTenantUserRolesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  role?: [ string ](name='Role', description='The list of roles of the user.   
Valid values: 

ReadWrite: a role that has the read and write privileges, namely ALL PRIVILEGES.
ReadOnly: a role that has only the read-only privilege SELECT.
DDL: a role that has DDL privileges such as CREATE, DROP, ALTER, SHOW VIEW, and CREATE VIEW.
DML: a role that has DML privileges such as SELECT, INSERT, UPDATE, DELETE, and SHOW VIEW.'),
}

model DescribeTenantUserRolesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantUserRolesResponseBody(name='body'),
}

/**
 * @summary You can call this operation to obtain the account authorization information of the tenant.
 *
 * @param request DescribeTenantUserRolesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantUserRolesResponse
 */
async function describeTenantUserRolesWithOptions(request: DescribeTenantUserRolesRequest, runtime: Util.RuntimeOptions): DescribeTenantUserRolesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenantUserRoles',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to obtain the account authorization information of the tenant.
 *
 * @param request DescribeTenantUserRolesRequest
 * @return DescribeTenantUserRolesResponse
 */
async function describeTenantUserRoles(request: DescribeTenantUserRolesRequest): DescribeTenantUserRolesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantUserRolesWithOptions(request, runtime);
}

model DescribeTenantUsersRequest {
  pageNumber?: int32(name='PageNumber', description='The database privileges of the account.', example='1'),
  pageSize?: int32(name='PageSize', description='The return result of the request.', example='10'),
  searchKey?: string(name='SearchKey', description='The return result of the request.', example='pay'),
  tenantId?: string(name='TenantId', description='The return result of the request.

This parameter is required.', example='ob2mr3oae0****'),
  userName?: string(name='UserName', description='The operation that you want to perform.   
Set the value to **DescribeTenantUsers**.', example='pay_test'),
}

model DescribeTenantUsersResponseBody = {
  requestId?: string(name='RequestId', description='The name of the database account.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenantUsers?: [ 
    {
      databases?: [ 
        {
          database?: string(name='Database', example='db_pay1'),
          privileges?: string(name='Privileges'),
          role?: string(name='Role', example='ReadOnly'),
          table?: string(name='Table', example='tbl_pay1'),
        }
      ](name='Databases'),
      description?: string(name='Description', example='use for test'),
      globalPermissions?: string(name='GlobalPermissions', example='Encrypt,Decrypt'),
      instanceId?: string(name='InstanceId', description='所属集群Id', example='obshc32****'),
      tenantId?: string(name='TenantId', description='所属租户Id', example='tshfs3****'),
      userName?: string(name='UserName', example='pay_test'),
      userStatus?: string(name='UserStatus', example='NORMAL'),
      userType?: string(name='UserType', example='NORMAL'),
    }
  ](name='TenantUsers', description='The type of the database account. Valid values:    
- Admin: the super administrator account.   
- NORMAL: a general account.'),
  totalCount?: int32(name='TotalCount', description='The role of the account.   
In Oracle mode, a role is a schema-level role. Valid values:  
- ReadWrite: a role that has the read and write privileges, including: CREATE TABLE, CREATE VIEW, CREATE PROCEDURE, CREATE SYNONYM, CREATE SEQUENCE, CREATE TRIGGER, CREATE TYPE, CREATE SESSION, EXECUTE ANY PROCEDURE, CREATE ANY OUTLINE, ALTER ANY OUTLINE, DROP ANY OUTLINE, CREATE ANY PROCEDURE, ALTER ANY PROCEDURE, DROP ANY PROCEDURE, CREATE ANY SEQUENCE, ALTER ANY SEQUENCE, DROP ANY SEQUENCE, CREATE ANY TYPE, ALTER ANY TYPE, DROP ANY TYPE, SYSKM, CREATE ANY TRIGGER, ALTER ANY TRIGGER, DROP ANY TRIGGER, CREATE PROFILE, ALTER PROFILE, and DROP PROFILE.  
- ReadOnly: a role that has only the read-only privilege SELECT.
In MySQL mode, a role is a database-level role. Valid values: 
- ReadWrite: a role that has the read and write privileges, namely ALL PRIVILEGES.   
- ReadOnly: a role that has only the read-only privilege SELECT.   
- DDL: a role that has the DDL privileges such as CREATE, DROP, ALTER, SHOW VIEW, and CREATE VIEW.   
- DML: a role that has the DML privileges such as SELECT, INSERT, UPDATE, DELETE, and SHOW VIEW.   

> <br>By default, an Oracle account has the read and write privileges on its own schema, which are not listed here.', example='1'),
}

model DescribeTenantUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantUsersResponseBody(name='body'),
}

/**
 * @summary The return result of the request.
 *
 * @param request DescribeTenantUsersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantUsersResponse
 */
async function describeTenantUsersWithOptions(request: DescribeTenantUsersRequest, runtime: Util.RuntimeOptions): DescribeTenantUsersResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.searchKey)) {
    body['SearchKey'] = request.searchKey;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenantUsers',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The return result of the request.
 *
 * @param request DescribeTenantUsersRequest
 * @return DescribeTenantUsersResponse
 */
async function describeTenantUsers(request: DescribeTenantUsersRequest): DescribeTenantUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantUsersWithOptions(request, runtime);
}

model DescribeTenantZonesReadRequest {
  instanceId?: string(name='InstanceId', description='The zone information of the tenant.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The return result of the request.

This parameter is required.', example='ob2mr3oae0****'),
}

model DescribeTenantZonesReadResponseBody = {
  requestId?: string(name='RequestId', description='Indicates whether a read-only connection needs to be created for the zone.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenantZones?: [ 
    {
      isElectable?: boolean(name='IsElectable', description='Example 1', example='true'),
      isPrimary?: boolean(name='IsPrimary', example='true'),
      isReadable?: string(name='IsReadable', example='true'),
      zone?: string(name='Zone', example='cn-hangzhou-i'),
    }
  ](name='TenantZones', description='The request ID.'),
}

model DescribeTenantZonesReadResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantZonesReadResponseBody(name='body'),
}

/**
 * @summary Indicates whether a read-only connection has been created.
 *
 * @param request DescribeTenantZonesReadRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantZonesReadResponse
 */
async function describeTenantZonesReadWithOptions(request: DescribeTenantZonesReadRequest, runtime: Util.RuntimeOptions): DescribeTenantZonesReadResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenantZonesRead',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Indicates whether a read-only connection has been created.
 *
 * @param request DescribeTenantZonesReadRequest
 * @return DescribeTenantZonesReadResponse
 */
async function describeTenantZonesRead(request: DescribeTenantZonesReadRequest): DescribeTenantZonesReadResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantZonesReadWithOptions(request, runtime);
}

model DescribeTenantsRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.   
Start value: 1
- Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of rows to return on each page.   
- Maximum value: 100.
- Default value: 10', example='10'),
  searchKey?: string(name='SearchKey', description='The search keyword.', example='pay'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.', example='ob2mr3oae0****'),
  tenantName?: string(name='TenantName', description='The name of the tenant.   
It must start with a letter or an underscore (_), and contain 2 to 20 characters, which can be uppercase letters, lowercase letters, digits, and underscores (_).  It cannot be set to sys.', example='pay_online'),
}

model DescribeTenantsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenants?: [ 
    {
      charset?: string(name='Charset', description='The character set.', example='utf8mb4'),
      collation?: string(name='Collation', description='The collation.', example='utf8mb4_general_ci'),
      cpu?: int32(name='Cpu', description='The total number of CPU cores of the tenant.', example='10'),
      createTime?: string(name='CreateTime', description='The time when the tenant was created.', example='2021-09-17 15:52:17.0'),
      deployMode?: string(name='DeployMode', description='The data replica distribution mode of the tenant.   

- For the high availability version, N-N-N indicates the three-zone mode, and N-N indicates the dual-zone or single-zone mode.
- For the basic version, N indicates the single-zone mode. 

> <br>N represents the number of nodes in a single zone.', example='1-1-1'),
      deployType?: string(name='DeployType', description='The deployment type of the tenant. <br>
- multiple: multi-IDC deployment
- single: single-IDC deployment
- dual: dual-IDC deployment', example='multiple'),
      description?: string(name='Description', description='The description of the tenant.', example='PayCore business database'),
      enableReadOnlyReplica?: boolean(name='EnableReadOnlyReplica', description='Indicates whether read-only replicas are supported.', example='true'),
      mem?: int32(name='Mem', description='The total memory size of the tenant, in GB.', example='20'),
      parameterTemplate?: string(name='ParameterTemplate', description='The parameter template.', example='express_oltp'),
      primaryZone?: string(name='PrimaryZone', description='The primary zone of the tenant.', example='cn-hangzhou-i'),
      status?: string(name='Status', description='The status of the tenant.  <br>
- PENDING_CREATE: The tenant is being created.
- RESTORE: The tenant is being recovered.
- ONLINE: The tenant is running.
- SPEC_MODIFYING: The specification of the tenant is being modified.
ALLOCATING_INTERNET_ADDRESS: An Internet address is being allocated.
PENDING_OFFLINE_INTERNET_ADDRESS: The Internet address is being disabled.
- PRIMARY_ZONE_MODIFYING: The tenant is switching to a new primary zone.
- PARAMETER_MODIFYING: Parameters are being modified.
- WHITE_LIST_MODIFYING: The whitelist is being modified.', example='ONLINE'),
      tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t33h8y08k****'),
      tenantMode?: string(name='TenantMode', description='The tenant mode.   
Valid values:   
Oracle
MySQL', example='Oracle'),
      tenantName?: string(name='TenantName', description='The name of the tenant.', example='pay_online'),
      unitCpu?: int32(name='UnitCpu', description='The number of CPU cores in each resource unit of the tenant.', example='5'),
      unitMem?: int32(name='UnitMem', description='The memory size of each resource unit of the tenant, in GB.', example='10'),
      unitNum?: int32(name='UnitNum', description='The number of resource units in the tenant.', example='2'),
      usedDiskSize?: double(name='UsedDiskSize', description='The number of used disks of the tenant.', example='10'),
      vpcId?: string(name='VpcId', description='The ID of the VPC.   <br>If no suitable VPC is available, create a VPC as prompted. For more information, see "What is a VPC".', example='vpc-bp1d2q3mhg9i23ofi****'),
    }
  ](name='Tenants', description='The information of tenants.'),
  totalCount?: int32(name='TotalCount', description='The total number of tenants in the specified OceanBase cluster.', example='1'),
}

model DescribeTenantsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTenantsResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the tenants in an OceanBase cluster.
 *
 * @param request DescribeTenantsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTenantsResponse
 */
async function describeTenantsWithOptions(request: DescribeTenantsRequest, runtime: Util.RuntimeOptions): DescribeTenantsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.searchKey)) {
    body['SearchKey'] = request.searchKey;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.tenantName)) {
    body['TenantName'] = request.tenantName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTenants',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the tenants in an OceanBase cluster.
 *
 * @param request DescribeTenantsRequest
 * @return DescribeTenantsResponse
 */
async function describeTenants(request: DescribeTenantsRequest): DescribeTenantsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTenantsWithOptions(request, runtime);
}

model DescribeTimeZonesResponseBody = {
  requestId?: string(name='RequestId', description='DescribeTimeZones', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  timeZones?: {
    default?: string(name='Default', example='Asia/Shanghai'),
    list?: [ 
      {
        description?: string(name='Description', description='Example 1', example='(GMT+8:00) Asia/Shanghai'),
        timeZone?: string(name='TimeZone', description='The operation that you want to perform.   
Set the value to **DescribeTimeZones**.', example='Asia/Shanghai'),
      }
    ](name='List', description='The list of time zones.'),
  }(name='TimeZones', description='The description of the time zone.'),
}

model DescribeTimeZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTimeZonesResponseBody(name='body'),
}

/**
 * @summary The time zones supported by the tenant.
 *
 * @param request DescribeTimeZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTimeZonesResponse
 */
async function describeTimeZonesWithOptions(runtime: Util.RuntimeOptions): DescribeTimeZonesResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeTimeZones',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The time zones supported by the tenant.
 *
 * @return DescribeTimeZonesResponse
 */
async function describeTimeZones(): DescribeTimeZonesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTimeZonesWithOptions(runtime);
}

model DescribeTopSQLListRequest {
  dbName?: string(name='DbName', description='The number of block index cache hits.', example='testdb'),
  endTime?: string(name='EndTime', description='The SQL type.

This parameter is required.', example='2021-09-13T15:40:43Z'),
  filterCondition?: map[string]any(name='FilterCondition', description='The average number of logical reads of the SQL statement during the specified period of time.   
The value covers the numbers of reads of different caches and the number of disk I/Os. It is an important metric for measuring the SQL filtering performance.   

> <br> A higher ratio of the number of logical reads to the number of returned rows indicates poorer filtering performance. General causes include non-standard content written by SQL statements, non-standard table indexes created, and non-standard SQL execution plans.', example='[dbName:sys]'),
  nodeIp?: string(name='NodeIp', description='The number of failures.', example='i-bp19y05uq6xpacyqnlrc'),
  pageNumber?: int32(name='PageNumber', description='The queuing time, in ms.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of row cache hits.', example='10'),
  SQLId?: string(name='SQLId', description='The I/O wait time, in ms.', example='8D6E84****0B8FB1823D199E2CA1****'),
  searchKeyWord?: string(name='SearchKeyWord', description='The number of retries.', example='update'),
  searchParameter?: string(name='SearchParameter', description='SQLID.', example='cputime'),
  searchRule?: string(name='SearchRule', description='The IP address of the client.', example='>'),
  searchValue?: string(name='SearchValue', description='The number of Bloom filter cache hits.', example='0.01'),
  sortColumn?: string(name='SortColumn', description='The number of rows read from the disk.', example='cputime'),
  sortOrder?: string(name='SortOrder', description='The list of top SQL statements.', example='desc'),
  startTime?: string(name='StartTime', description='The maximum response time, in ms.

This parameter is required.', example='2021-06-13T15:40:43Z'),
  tenantId?: string(name='TenantId', description='The average CPU time, in ms.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeTopSQLListShrinkRequest {
  dbName?: string(name='DbName', description='The number of block index cache hits.', example='testdb'),
  endTime?: string(name='EndTime', description='The SQL type.

This parameter is required.', example='2021-09-13T15:40:43Z'),
  filterConditionShrink?: string(name='FilterCondition', description='The average number of logical reads of the SQL statement during the specified period of time.   
The value covers the numbers of reads of different caches and the number of disk I/Os. It is an important metric for measuring the SQL filtering performance.   

> <br> A higher ratio of the number of logical reads to the number of returned rows indicates poorer filtering performance. General causes include non-standard content written by SQL statements, non-standard table indexes created, and non-standard SQL execution plans.', example='[dbName:sys]'),
  nodeIp?: string(name='NodeIp', description='The number of failures.', example='i-bp19y05uq6xpacyqnlrc'),
  pageNumber?: int32(name='PageNumber', description='The queuing time, in ms.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of row cache hits.', example='10'),
  SQLId?: string(name='SQLId', description='The I/O wait time, in ms.', example='8D6E84****0B8FB1823D199E2CA1****'),
  searchKeyWord?: string(name='SearchKeyWord', description='The number of retries.', example='update'),
  searchParameter?: string(name='SearchParameter', description='SQLID.', example='cputime'),
  searchRule?: string(name='SearchRule', description='The IP address of the client.', example='>'),
  searchValue?: string(name='SearchValue', description='The number of Bloom filter cache hits.', example='0.01'),
  sortColumn?: string(name='SortColumn', description='The number of rows read from the disk.', example='cputime'),
  sortOrder?: string(name='SortOrder', description='The list of top SQL statements.', example='desc'),
  startTime?: string(name='StartTime', description='The maximum response time, in ms.

This parameter is required.', example='2021-06-13T15:40:43Z'),
  tenantId?: string(name='TenantId', description='The average CPU time, in ms.

This parameter is required.', example='t2mr3oae0****'),
}

model DescribeTopSQLListResponseBody = {
  requestId?: string(name='RequestId', description='Alibaba Cloud CLI', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  topSQLList?: [ 
    {
      affectedRows?: long(name='AffectedRows', description='The internal wait time, in ms.', example='0'),
      appWaitTime?: float(name='AppWaitTime', description='The wait time in concurrent execution, in ms.', example='0.0'),
      blockCacheHit?: long(name='BlockCacheHit', description='The average CPU time, in ms.', example='14'),
      blockIndexCacheHit?: long(name='BlockIndexCacheHit', description='$.parameters[16].schema.example', example='4'),
      bloomFilterCacheHit?: long(name='BloomFilterCacheHit', description='$.parameters[14].schema.enumValueTitles', example='0'),
      clientIp?: string(name='ClientIp', description='$.parameters[14].schema.description', example='1*2.***.1*3.***'),
      concurrencyWaitTime?: float(name='ConcurrencyWaitTime', description='The number of rows returned.', example='0.0'),
      cpuTime?: float(name='CpuTime', description='The maximum CPU time, in ms.', example='50.13'),
      dbName?: string(name='DbName', description='The number of remote plans.', example='testdb'),
      decodeTime?: float(name='DecodeTime', description='The number of rows to return on each page.   
- Maximum value: 100   
- Default value: 10', example='0.0'),
      diskRead?: long(name='DiskRead', description='The IP address of the client.', example='0'),
      elapsedTime?: float(name='ElapsedTime', description='The sorting rule.', example='76.382'),
      event?: string(name='Event', description='The number of rows read from the disk.', example='mysql response wait client'),
      execPerSecond?: float(name='ExecPerSecond', description='The operation that you want to perform.   
Set the value to **DescribeTopSQLList**.', example='163.0'),
      executeTime?: float(name='ExecuteTime', description='The number of rows read from the memory.', example='61.044'),
      executions?: long(name='Executions', description='The number of executions per second.', example='89403'),
      failTimes?: long(name='FailTimes', description='$.parameters[12].schema.description', example='0'),
      getPlanTime?: float(name='GetPlanTime', description='The queuing time, in ms.', example='0.052'),
      IOWaitTime?: float(name='IOWaitTime', description='$.parameters[15].schema.example', example='0.0'),
      key?: long(name='Key', description='The name of the database.', example='1'),
      logicalRead?: long(name='LogicalRead', description='You can call this operation to query SQL execution performance data collected by the diagnostic system.', example='19'),
      maxCpuTime?: float(name='MaxCpuTime', description='SQLID.', example='257.967'),
      maxElapsedTime?: float(name='MaxElapsedTime', description='The sequence number of the returned SQL statement.', example='260.044'),
      memstoreReadRowCount?: long(name='MemstoreReadRowCount', description='The name of the database.', example='527'),
      missPlans?: long(name='MissPlans', description='The total count.', example='0'),
      netWaitTime?: float(name='NetWaitTime', description='The end time of the time range for querying TOP SQL statements.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.', example='0.0'),
      nodeIp?: string(name='NodeIp', description='The username.', example='i-bp18qljorblo8es*****'),
      queueTime?: float(name='QueueTime', description='$.parameters[12].schema.enumValueTitles', example='15.275'),
      RPCCount?: long(name='RPCCount', description='The start time of the time range for querying TOP SQL statements.   
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.', example='0'),
      remotePlans?: long(name='RemotePlans', description='The return result of the request.', example='0'),
      retryCount?: long(name='RetryCount', description='$.parameters[13].schema.description', example='0'),
      returnRows?: long(name='ReturnRows', description='The wait event.', example='1'),
      rowCacheHit?: long(name='RowCacheHit', description='```
http(s)://[Endpoint]/?Action=DescribeTopSQLList
&TenantId=t2mr3oae0****
&StartTime=2021-06-13 15:40:43
&EndTime=2021-09-13 15:40:43
&DbName=testdb
&SearchKeyWord=update
&SearchParameter=cputime
&SearchRule=>
&SearchValue=0.01
&SQLId=8D6E84****0B8FB1823D199E2CA1****
&NodeIp=i-bp19y05uq6xpacyqnlrc
&PageNumber=1
&PageSize=10
&SortColumn=cputime
&SortOrder=desc
&Common request parameters
```', example='0'),
      SQLId?: string(name='SQLId', description='$.parameters[13].schema.example', example='8D6E84****0B8FB1823D199E2CA1****'),
      SQLText?: string(name='SQLText', description='The list of top SQL statements.', example='SELECT  ****   FROM ****   WHERE **** = ? AND **** = ?   ORDER BY **** ASC'),
      SQLType?: long(name='SQLType', description='The request ID.', example='1'),
      scheduleTime?: float(name='ScheduleTime', description='The search keyword.', example='0.0'),
      ssstoreReadRowCount?: long(name='SsstoreReadRowCount', example='43086'),
      totalWaitTime?: float(name='TotalWaitTime', description='-', example='10.966'),
      userName?: string(name='UserName', description='The number of Bloom filter cache hits.', example='tester'),
    }
  ](name='TopSQLList', description='The I/O wait time, in ms.'),
  totalCount?: long(name='TotalCount', description='It is an online CLI tool that allows you to quickly retrieve and debug APIs. It can dynamically generate executable SDK code samples.', example='9'),
}

model DescribeTopSQLListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTopSQLListResponseBody(name='body'),
}

/**
 * @summary The name of the database.
 *
 * @param tmpReq DescribeTopSQLListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTopSQLListResponse
 */
async function describeTopSQLListWithOptions(tmpReq: DescribeTopSQLListRequest, runtime: Util.RuntimeOptions): DescribeTopSQLListResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeTopSQLListShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.filterCondition)) {
    request.filterConditionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterCondition, 'FilterCondition', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dbName)) {
    body['DbName'] = request.dbName;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.filterConditionShrink)) {
    body['FilterCondition'] = request.filterConditionShrink;
  }
  if (!Util.isUnset(request.nodeIp)) {
    body['NodeIp'] = request.nodeIp;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.SQLId)) {
    body['SQLId'] = request.SQLId;
  }
  if (!Util.isUnset(request.searchKeyWord)) {
    body['SearchKeyWord'] = request.searchKeyWord;
  }
  if (!Util.isUnset(request.searchParameter)) {
    body['SearchParameter'] = request.searchParameter;
  }
  if (!Util.isUnset(request.searchRule)) {
    body['SearchRule'] = request.searchRule;
  }
  if (!Util.isUnset(request.searchValue)) {
    body['SearchValue'] = request.searchValue;
  }
  if (!Util.isUnset(request.sortColumn)) {
    body['SortColumn'] = request.sortColumn;
  }
  if (!Util.isUnset(request.sortOrder)) {
    body['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTopSQLList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The name of the database.
 *
 * @param request DescribeTopSQLListRequest
 * @return DescribeTopSQLListResponse
 */
async function describeTopSQLList(request: DescribeTopSQLListRequest): DescribeTopSQLListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTopSQLListWithOptions(request, runtime);
}

model DescribeZonesRequest {
  cpuArch?: string(name='CpuArch', example='x86'),
  deployType?: string(name='DeployType', description='The operation that you want to perform.   
Set the value to **DescribeZones**.', example='single'),
  series?: string(name='Series', description='The deployment mode.', example='NORMAL'),
}

model DescribeZonesResponseBody = {
  requestId?: string(name='RequestId', description='```
http(s)://[Endpoint]/?Action=DescribeZones
&Series=normal
&DeployType=single
&Common request parameters
```', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  zones?: [ 
    {
      deployType?: string(name='DeployType', example='1-1-1'),
      series?: string(name='Series', example='NORMAL'),
      zoneId?: string(name='ZoneId', example='cn-hangzhou-i,cn-hangzhou-j,cn-hangzhou-h'),
      zoneName?: string(name='ZoneName', example='H/I/J'),
    }
  ](name='Zones', description='You can call this operation to learn of zones where a cluster can be created in an Alibaba Cloud region.'),
}

model DescribeZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeZonesResponseBody(name='body'),
}

/**
 * @summary The deployment mode.
 *
 * @param request DescribeZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeZonesResponse
 */
async function describeZonesWithOptions(request: DescribeZonesRequest, runtime: Util.RuntimeOptions): DescribeZonesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cpuArch)) {
    body['CpuArch'] = request.cpuArch;
  }
  if (!Util.isUnset(request.deployType)) {
    body['DeployType'] = request.deployType;
  }
  if (!Util.isUnset(request.series)) {
    body['Series'] = request.series;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeZones',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The deployment mode.
 *
 * @param request DescribeZonesRequest
 * @return DescribeZonesResponse
 */
async function describeZones(request: DescribeZonesRequest): DescribeZonesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeZonesWithOptions(request, runtime);
}

model GetUploadOssUrlRequest {
  effectiveTimeMinutes?: int32(name='EffectiveTimeMinutes', example='10'),
  type?: string(name='Type', description='This parameter is required.', example='CREATE_PROJECT'),
}

model GetUploadOssUrlResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='278'),
  data?: {
    expectedExpirationTime?: string(name='ExpectedExpirationTime', example='2023-07-26T06:33:11.175'),
    ossKey?: string(name='OssKey', example='open_api_create_project/oacp_4xd****vk'),
    ossUrl?: string(name='OssUrl', example='https://cn-hangzhou-pre-omsstore.oss-cn-hangzhou.aliyuncs.com/open_api_create_project/oacp_4x****pvk?Expires=169031&OSSAccessKeyId=LTAI5tMN52D***TBf&Signature=XdDFPz%2BXKC***%2B'),
  }(name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='null'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='11'),
}

model GetUploadOssUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUploadOssUrlResponseBody(name='body'),
}

/**
 * @summary 公有云上传OSS 获取一个临时上传url
 *
 * @param request GetUploadOssUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUploadOssUrlResponse
 */
async function getUploadOssUrlWithOptions(request: GetUploadOssUrlRequest, runtime: Util.RuntimeOptions): GetUploadOssUrlResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.effectiveTimeMinutes)) {
    body['EffectiveTimeMinutes'] = request.effectiveTimeMinutes;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetUploadOssUrl',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 公有云上传OSS 获取一个临时上传url
 *
 * @param request GetUploadOssUrlRequest
 * @return GetUploadOssUrlResponse
 */
async function getUploadOssUrl(request: GetUploadOssUrlRequest): GetUploadOssUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUploadOssUrlWithOptions(request, runtime);
}

model KillProcessListRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  sessionList?: string(name='SessionList', description='The list of the sessions that need to be closed.

This parameter is required.', example='[{"ServerIp":"192.168.13.119","SessionId":"3221614618"}]'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model KillProcessListResponseBody = {
  data?: [ 
    {
      clientIp?: string(name='ClientIp', description='The client IP address.', example='127.0.0.1'),
      command?: string(name='Command', description='The start command for the container of the application.', example='select 1'),
      database?: string(name='Database', description='The name of the database.', example='test'),
      errorMessage?: string(name='ErrorMessage', description='The error message.', example='Instance not found.'),
      executeTime?: string(name='ExecuteTime', description='Execution time (UTC+8). If it is left empty, it means to execute immediately.', example='142'),
      serverIp?: string(name='ServerIp', description='The IP address of the server.', example='127.0.0.1'),
      sessionId?: long(name='SessionId', description='The ID of the session.', example='1123'),
      sqlText?: string(name='SqlText', description='The SQL statement.', example=':'),
      status?: string(name='Status', description='The status of the task.', example='SLEEP'),
      tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t3ogqv07a56n4'),
      user?: string(name='User', description='The database username.', example='oas'),
    }
  ](name='Data', description='The data returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model KillProcessListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: KillProcessListResponseBody(name='body'),
}

/**
 * @summary You can call this operation to close a session.
 *
 * @param request KillProcessListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return KillProcessListResponse
 */
async function killProcessListWithOptions(request: KillProcessListRequest, runtime: Util.RuntimeOptions): KillProcessListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.sessionList)) {
    body['SessionList'] = request.sessionList;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'KillProcessList',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to close a session.
 *
 * @param request KillProcessListRequest
 * @return KillProcessListResponse
 */
async function killProcessList(request: KillProcessListRequest): KillProcessListResponse {
  var runtime = new Util.RuntimeOptions{};
  return killProcessListWithOptions(request, runtime);
}

model ListAllLabelsResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: [ 
    {
      id?: string(name='Id', example='l_4w6r0***'),
      name?: string(name='Name', example='test'),
    }
  ](name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='29'),
}

model ListAllLabelsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAllLabelsResponseBody(name='body'),
}

/**
 * @summary 查询标签列表
 *
 * @param request ListAllLabelsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAllLabelsResponse
 */
async function listAllLabelsWithOptions(runtime: Util.RuntimeOptions): ListAllLabelsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListAllLabels',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询标签列表
 *
 * @return ListAllLabelsResponse
 */
async function listAllLabels(): ListAllLabelsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllLabelsWithOptions(runtime);
}

model ListDataSourceRequest {
  order?: string(name='Order', example='descend'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='10'),
  searchKey?: string(name='SearchKey', example='GRATI****89278244'),
  sortField?: string(name='SortField', example='gmtCreate'),
  types?: [ string ](name='Types'),
}

model ListDataSourceShrinkRequest {
  order?: string(name='Order', example='descend'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='10'),
  searchKey?: string(name='SearchKey', example='GRATI****89278244'),
  sortField?: string(name='SortField', example='gmtCreate'),
  typesShrink?: string(name='Types'),
}

model ListDataSourceResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='28'),
  data?: [ 
    {
      charset?: string(name='Charset', example='utf8mb4'),
      cluster?: string(name='Cluster', example='cluster_name'),
      connExtraAttributes?: any(name='ConnExtraAttributes', example='null'),
      description?: string(name='Description', example='test'),
      gmtCreate?: string(name='GmtCreate', example='2023-07-13T20:27:28.000+00:00'),
      gmtModified?: string(name='GmtModified', example='2023-07-13T20:37:28.000+00:00'),
      id?: string(name='Id', example='e_4w****v'),
      ip?: string(name='Ip', example='xxx.xxx.xxx.1'),
      name?: string(name='Name', example='RATION***1DBUTF11'),
      operatingSystem?: string(name='OperatingSystem', example='Linux'),
      oracleNlsLengthSemantics?: string(name='OracleNlsLengthSemantics', example='null'),
      oracleSid?: string(name='OracleSid', example='null'),
      owner?: string(name='Owner', example='admin'),
      partnerId?: string(name='PartnerId', example='null'),
      port?: int32(name='Port', example='2883'),
      region?: string(name='Region', example='cn-beijing'),
      resourceOwner?: string(name='ResourceOwner', example='178641****05809'),
      role?: string(name='Role', example='MASTER'),
      schema?: string(name='Schema', example='schema_name'),
      tenant?: string(name='Tenant', example='tenant_name'),
      timezone?: string(name='Timezone', example='+08:00'),
      type?: string(name='Type', example='MYSQL_PUBLIC'),
      userName?: string(name='UserName', example='user_name'),
      version?: string(name='Version', example='4.1.0'),
      vpcId?: string(name='VpcId', example='vpc_t4***'),
    }
  ](name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='132'),
}

model ListDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDataSourceResponseBody(name='body'),
}

/**
 * @summary 查询数据源列表 (MySql、OB_MYSQL、OB_ORACLE)
 *
 * @param tmpReq ListDataSourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDataSourceResponse
 */
async function listDataSourceWithOptions(tmpReq: ListDataSourceRequest, runtime: Util.RuntimeOptions): ListDataSourceResponse {
  Util.validateModel(tmpReq);
  var request = new ListDataSourceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.types)) {
    request.typesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.types, 'Types', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.order)) {
    body['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.searchKey)) {
    body['SearchKey'] = request.searchKey;
  }
  if (!Util.isUnset(request.sortField)) {
    body['SortField'] = request.sortField;
  }
  if (!Util.isUnset(request.typesShrink)) {
    body['Types'] = request.typesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDataSource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询数据源列表 (MySql、OB_MYSQL、OB_ORACLE)
 *
 * @param request ListDataSourceRequest
 * @return ListDataSourceResponse
 */
async function listDataSource(request: ListDataSourceRequest): ListDataSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDataSourceWithOptions(request, runtime);
}

model ListProjectFullVerifyResultRequest {
  destSchemas?: [ string ](name='DestSchemas'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize'),
  projectId?: string(name='ProjectId', description='This parameter is required.', example='np_4w5abs****'),
  sourceSchemas?: [ string ](name='SourceSchemas'),
  status?: string(name='Status', example='FINISHED'),
}

model ListProjectFullVerifyResultShrinkRequest {
  destSchemasShrink?: string(name='DestSchemas'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize'),
  projectId?: string(name='ProjectId', description='This parameter is required.', example='np_4w5abs****'),
  sourceSchemasShrink?: string(name='SourceSchemas'),
  status?: string(name='Status', example='FINISHED'),
}

model ListProjectFullVerifyResultResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: {
    differentNumber?: long(name='DifferentNumber', example='11'),
    fullVerifyTableStatistics?: [ 
      {
        consistentCount?: long(name='ConsistentCount', example='200'),
        destOnlyCount?: long(name='DestOnlyCount', example='0'),
        destSchemaName?: string(name='DestSchemaName', example='dest_db'),
        errorDetails?: [ 
          {
            code?: string(name='Code', example='CM-RESOAT1111'),
            extraContext?: map[string]any(name='ExtraContext'),
            level?: string(name='Level', example='ERROR'),
            message?: string(name='Message', example='null'),
            messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
            messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
            proposal?: string(name='Proposal', example='null'),
            proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
            proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
            reason?: string(name='Reason', example='null'),
            reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
            reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
            upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
          }
        ](name='ErrorDetails'),
        message?: string(name='Message', example='null'),
        mismatchedCount?: long(name='MismatchedCount', example='0'),
        progress?: string(name='Progress', example='80'),
        resultDesc?: string(name='ResultDesc', example='desc'),
        resultType?: string(name='ResultType', example='RUNNING'),
        sourceOnlyCount?: long(name='SourceOnlyCount', example='0'),
        sourceSchemaName?: string(name='SourceSchemaName', example='source_db'),
        sourceTableName?: string(name='SourceTableName', example='source_table'),
        status?: string(name='Status', example='RUNNING'),
      }
    ](name='FullVerifyTableStatistics'),
  }(name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='1'),
}

model ListProjectFullVerifyResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectFullVerifyResultResponseBody(name='body'),
}

/**
 * @summary 查询项目的全量校验结果
 *
 * @param tmpReq ListProjectFullVerifyResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectFullVerifyResultResponse
 */
async function listProjectFullVerifyResultWithOptions(tmpReq: ListProjectFullVerifyResultRequest, runtime: Util.RuntimeOptions): ListProjectFullVerifyResultResponse {
  Util.validateModel(tmpReq);
  var request = new ListProjectFullVerifyResultShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.destSchemas)) {
    request.destSchemasShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.destSchemas, 'DestSchemas', 'json');
  }
  if (!Util.isUnset(tmpReq.sourceSchemas)) {
    request.sourceSchemasShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sourceSchemas, 'SourceSchemas', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.destSchemasShrink)) {
    body['DestSchemas'] = request.destSchemasShrink;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sourceSchemasShrink)) {
    body['SourceSchemas'] = request.sourceSchemasShrink;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListProjectFullVerifyResult',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询项目的全量校验结果
 *
 * @param request ListProjectFullVerifyResultRequest
 * @return ListProjectFullVerifyResultResponse
 */
async function listProjectFullVerifyResult(request: ListProjectFullVerifyResultRequest): ListProjectFullVerifyResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return listProjectFullVerifyResultWithOptions(request, runtime);
}

model ListProjectModifyRecordsRequest {
  id?: string(name='Id', description='This parameter is required.', example='np_598jmu****'),
}

model ListProjectModifyRecordsResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='30'),
  data?: [ 
    {
      databases?: [ 
        {
          id?: string(name='Id', example='db_id'),
          mappedName?: string(name='MappedName', example='mapped_db'),
          name?: string(name='Name', example='db_name'),
          specificTables?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: int32(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              columns?: [ 
                {
                  columnComment?: string(name='ColumnComment', example='comments'),
                  columnKey?: string(name='ColumnKey', example='PRI'),
                  columnName?: string(name='ColumnName', example='col_name'),
                  columnType?: string(name='ColumnType', example='FLOAT'),
                  dataLength?: long(name='DataLength', example='null'),
                  dataPrecision?: int32(name='DataPrecision', example='64'),
                  dataScale?: int32(name='DataScale', example='null'),
                  defaultValue?: string(name='DefaultValue', example='null'),
                  encoding?: string(name='Encoding', example='utf16'),
                  isGenerateField?: boolean(name='IsGenerateField', example='false'),
                  mappedName?: string(name='MappedName', example='mapped_name'),
                  nullable?: boolean(name='Nullable', example='false'),
                  position?: int32(name='Position', example='null'),
                  rawColumnType?: string(name='RawColumnType', example='null'),
                  recordFieldType?: string(name='RecordFieldType', example='INT8'),
                  type?: string(name='Type', example='DATABASE'),
                }
              ](name='Columns'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='table_id'),
              mappedName?: string(name='MappedName', example='mapped_name'),
              name?: string(name='Name', example='table_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id<3'),
            }
          ](name='SpecificTables'),
          specificViews?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: int32(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              columns?: [ 
                {
                  columnComment?: string(name='ColumnComment', example='comments'),
                  columnKey?: string(name='ColumnKey', example='PRI'),
                  columnName?: string(name='ColumnName', example='col_name'),
                  columnType?: string(name='ColumnType', example='FLOAT'),
                  dataLength?: long(name='DataLength', example='null'),
                  dataPrecision?: int32(name='DataPrecision', example='64'),
                  dataScale?: int32(name='DataScale', example='null'),
                  defaultValue?: string(name='DefaultValue', example='null'),
                  encoding?: string(name='Encoding', example='utf16'),
                  isGenerateField?: boolean(name='IsGenerateField', example='false'),
                  mappedName?: string(name='MappedName', example='mapped_name'),
                  nullable?: boolean(name='Nullable', example='true'),
                  position?: int32(name='Position', example='null'),
                  rawColumnType?: string(name='RawColumnType', example='null'),
                  recordFieldType?: string(name='RecordFieldType', example='INT8'),
                  type?: string(name='Type', example='DATABASE'),
                }
              ](name='Columns'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='table_id'),
              mappedName?: string(name='MappedName', example='mapped_name'),
              name?: string(name='Name', example='table_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id < 1'),
            }
          ](name='SpecificViews'),
          tables?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: int32(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              columns?: [ 
                {
                  columnComment?: string(name='ColumnComment', example='comments'),
                  columnKey?: string(name='ColumnKey', example='PRI'),
                  columnName?: string(name='ColumnName', example='col_name'),
                  columnType?: string(name='ColumnType', example='FLOAT'),
                  dataLength?: long(name='DataLength', example='null'),
                  dataPrecision?: int32(name='DataPrecision', example='64'),
                  dataScale?: int32(name='DataScale', example='null'),
                  defaultValue?: string(name='DefaultValue', example='null'),
                  encoding?: string(name='Encoding', example='utf8'),
                  isGenerateField?: boolean(name='IsGenerateField', example='false'),
                  mappedName?: string(name='MappedName', example='mapped_col'),
                  nullable?: boolean(name='Nullable', example='true'),
                  position?: int32(name='Position', example='null'),
                  rawColumnType?: string(name='RawColumnType', example='null'),
                  recordFieldType?: string(name='RecordFieldType', example='INT8'),
                  type?: string(name='Type', example='DATABASE'),
                }
              ](name='Columns'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='table_id'),
              mappedName?: string(name='MappedName', example='mapped_name'),
              name?: string(name='Name', example='table_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id < 1'),
            }
          ](name='Tables'),
          views?: [ 
            {
              adbTableSchema?: {
                distributedKeys?: [ string ](name='DistributedKeys'),
                partitionLifeCycle?: int32(name='PartitionLifeCycle', example='30'),
                partitionStatement?: string(name='PartitionStatement', example='PARTITION BY VALUE(\\\\"id\\\\")'),
                primaryKeys?: [ string ](name='PrimaryKeys'),
              }(name='AdbTableSchema'),
              columns?: [ 
                {
                  columnComment?: string(name='ColumnComment', example='comments'),
                  columnKey?: string(name='ColumnKey', example='PRI'),
                  columnName?: string(name='ColumnName', example='col_name'),
                  columnType?: string(name='ColumnType', example='FLOAT'),
                  dataLength?: long(name='DataLength', example='null'),
                  dataPrecision?: int32(name='DataPrecision', example='64'),
                  dataScale?: int32(name='DataScale', example='null'),
                  defaultValue?: string(name='DefaultValue', example='null'),
                  encoding?: string(name='Encoding', example='utf16'),
                  isGenerateField?: boolean(name='IsGenerateField', example='false'),
                  mappedName?: string(name='MappedName', example='mapped_name'),
                  nullable?: boolean(name='Nullable', example='false'),
                  position?: int32(name='Position', example='null'),
                  rawColumnType?: string(name='RawColumnType', example='null'),
                  recordFieldType?: string(name='RecordFieldType', example='INT8'),
                  type?: string(name='Type', example='DATABASE'),
                }
              ](name='Columns'),
              filterColumns?: [ string ](name='FilterColumns'),
              id?: string(name='Id', example='table_id'),
              mappedName?: string(name='MappedName', example='mapped_view'),
              name?: string(name='Name', example='table_name'),
              shardColumns?: [ string ](name='ShardColumns'),
              whereClause?: string(name='WhereClause', example='id<1'),
            }
          ](name='Views'),
        }
      ](name='Databases'),
      errorDetail?: {
        code?: string(name='Code', example='INNER_ERROR'),
        extraContext?: map[string]any(name='ExtraContext'),
        level?: string(name='Level', example='ERROR'),
        message?: string(name='Message', example='A system error occurred.'),
        messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
        messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
        proposal?: string(name='Proposal', example='null'),
        proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
        proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
        reason?: string(name='Reason', example='null'),
        reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
        reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
        upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
      }(name='ErrorDetail'),
      gmtModified?: string(name='GmtModified', example='2023-07-13T06:26:15'),
      id?: long(name='Id', example='344000005'),
      mergeRequestId?: long(name='MergeRequestId', example='id'),
      migrationObjectsInfo?: {
        tables?: [ 
          {
            name?: string(name='Name', example='table_name'),
            schema?: string(name='Schema', example='schema_name'),
          }
        ](name='Tables'),
        tablesBlack?: [ 
          {
            name?: string(name='Name', example='table_name'),
            schema?: string(name='Schema', example='schema_name'),
          }
        ](name='TablesBlack'),
        views?: [ 
          {
            name?: string(name='Name', example='view_name'),
            schema?: string(name='Schema', example='schema_name'),
          }
        ](name='Views'),
        viewsBlack?: [ 
          {
            name?: string(name='Name', example='view_name'),
            schema?: string(name='Schema', example='schema_name'),
          }
        ](name='ViewsBlack'),
        wildcardMode?: boolean(name='WildcardMode', example='true'),
      }(name='MigrationObjectsInfo'),
      omsProjectMappingInfo?: {
        columnMappings?: [ 
          {
            destName?: string(name='DestName', example='dest_name'),
            sourceName?: string(name='SourceName', example='source_name'),
            sourceSchema?: string(name='SourceSchema', example='source_schema'),
            sourceTable?: string(name='SourceTable', example='source_table'),
          }
        ](name='ColumnMappings'),
        schemaMappings?: [ 
          {
            destName?: string(name='DestName', example='mapped_schema'),
            sourceName?: string(name='SourceName', example='source_name'),
          }
        ](name='SchemaMappings'),
        tableMappings?: [ 
          {
            destName?: string(name='DestName', example='dest_name'),
            sourceName?: string(name='SourceName', example='source_name'),
            sourceSchema?: string(name='SourceSchema', example='source_schema'),
          }
        ](name='TableMappings'),
        viewMappings?: [ 
          {
            destName?: string(name='DestName', example='dest_name'),
            sourceName?: string(name='SourceName', example='source_name'),
            sourceSchema?: string(name='SourceSchema', example='schema_name'),
          }
        ](name='ViewMappings'),
      }(name='OmsProjectMappingInfo'),
      status?: string(name='Status', example='PENDING'),
      subProjectId?: string(name='SubProjectId', example='np_598qm***'),
      tableEtlList?: [ 
        {
          database?: string(name='Database', example='db_name'),
          destDatabase?: string(name='DestDatabase', example='dest_db'),
          destName?: string(name='DestName', example='dest_name'),
          filterColumns?: [ string ](name='FilterColumns'),
          logicTableId?: string(name='LogicTableId', example='null'),
          shardColumns?: [ string ](name='ShardColumns'),
          sourceEndpointId?: string(name='SourceEndpointId', example='null'),
          tableName?: string(name='TableName', example='table_name'),
          tenantName?: string(name='TenantName', example='tenant_name'),
          whereClause?: string(name='WhereClause', example='id>1'),
        }
      ](name='TableEtlList'),
      type?: string(name='Type', example='INCREASE_OBJECT'),
      updateRequestId?: long(name='UpdateRequestId', example='id'),
    }
  ](name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='INNER_ERROR'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model ListProjectModifyRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectModifyRecordsResponseBody(name='body'),
}

/**
 * @summary 根据项目 ID 查询项目的修改记录
 *
 * @param request ListProjectModifyRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectModifyRecordsResponse
 */
async function listProjectModifyRecordsWithOptions(request: ListProjectModifyRecordsRequest, runtime: Util.RuntimeOptions): ListProjectModifyRecordsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListProjectModifyRecords',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据项目 ID 查询项目的修改记录
 *
 * @param request ListProjectModifyRecordsRequest
 * @return ListProjectModifyRecordsResponse
 */
async function listProjectModifyRecords(request: ListProjectModifyRecordsRequest): ListProjectModifyRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listProjectModifyRecordsWithOptions(request, runtime);
}

model ListProjectsRequest {
  labelIds?: [ string ](name='LabelIds'),
  needRelatedInfo?: boolean(name='NeedRelatedInfo'),
  order?: string(name='Order', example='descend'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  searchKey?: string(name='SearchKey', example='np_4w****'),
  sinkEndpointTypes?: [ string ](name='SinkEndpointTypes'),
  sortField?: string(name='SortField', example='gmtCreate'),
  sourceEndpointTypes?: [ string ](name='SourceEndpointTypes'),
  status?: [ string ](name='Status'),
  type?: string(name='Type', example='MIGRATION'),
  visibleSubProject?: boolean(name='VisibleSubProject', example='false'),
}

model ListProjectsShrinkRequest {
  labelIdsShrink?: string(name='LabelIds'),
  needRelatedInfo?: boolean(name='NeedRelatedInfo'),
  order?: string(name='Order', example='descend'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  searchKey?: string(name='SearchKey', example='np_4w****'),
  sinkEndpointTypesShrink?: string(name='SinkEndpointTypes'),
  sortField?: string(name='SortField', example='gmtCreate'),
  sourceEndpointTypesShrink?: string(name='SourceEndpointTypes'),
  statusShrink?: string(name='Status'),
  type?: string(name='Type', example='MIGRATION'),
  visibleSubProject?: boolean(name='VisibleSubProject', example='false'),
}

model ListProjectsResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: [ 
    {
      alarmStats?: {
        alarmContent?: string(name='AlarmContent', example='null'),
        alarming?: boolean(name='Alarming', example='false'),
        openMonitor?: boolean(name='OpenMonitor', example='true'),
        recentlyTriggerCount?: int32(name='RecentlyTriggerCount', example='0'),
        ruleToRecentlyTriggerCount?: map[string]int32(name='RuleToRecentlyTriggerCount'),
        target?: string(name='Target', example='null'),
      }(name='AlarmStats'),
      commonTransferConfig?: {
        activeActive?: boolean(name='ActiveActive', example='false'),
        dataWorksBusinessName?: string(name='DataWorksBusinessName', example='null'),
        datahubTopicType?: string(name='DatahubTopicType', example='TUPLE'),
        mqPartition?: int32(name='MqPartition', example='0'),
        mqPartitionMode?: string(name='MqPartitionMode', example='ONE'),
        mqSerializerType?: string(name='MqSerializerType', example='DEFAULT'),
        rocketMqEnableMsgTrace?: boolean(name='RocketMqEnableMsgTrace', example='false'),
        rocketMqMsgTags?: string(name='RocketMqMsgTags', example='default_tag'),
        rocketMqProducerGroup?: string(name='RocketMqProducerGroup', example='OMS'),
        rocketMqSendMsgTimeout?: long(name='RocketMqSendMsgTimeout', example='null'),
        tableCategory?: string(name='TableCategory', example='ALL'),
      }(name='CommonTransferConfig'),
      destConnId?: string(name='DestConnId', example='null'),
      enableFullTransfer?: boolean(name='EnableFullTransfer', example='true'),
      enableFullVerify?: boolean(name='EnableFullVerify', example='true'),
      enableIncrTransfer?: boolean(name='EnableIncrTransfer', example='true'),
      enableIncrVerify?: boolean(name='EnableIncrVerify', example='true'),
      enableReverseIncrTransfer?: boolean(name='EnableReverseIncrTransfer', example='true'),
      enableStructTransfer?: boolean(name='EnableStructTransfer', example='true'),
      extraInfo?: {
        accessObSource?: boolean(name='AccessObSource', example='true'),
        ignoreUnsupportDdl?: boolean(name='IgnoreUnsupportDdl', example='true'),
        incrSyncTimestamp?: long(name='IncrSyncTimestamp', example='1689244596'),
        logServiceStartCheckpoint?: long(name='LogServiceStartCheckpoint', example='1689214358'),
        maxConnectorCount?: int32(name='MaxConnectorCount', example='-1'),
        monitoringIncr?: boolean(name='MonitoringIncr', example='true'),
        overwriteConfig?: boolean(name='OverwriteConfig', example='true'),
        reverseSubtopics?: [ string ](name='ReverseSubtopics'),
        runningProgress?: int32(name='RunningProgress', example='90'),
        runningStep?: string(name='RunningStep', example='TRANSFER_PRECHECK'),
        sourceStoreKeptHour?: int32(name='SourceStoreKeptHour', example='24'),
        storeIncr?: boolean(name='StoreIncr', example='true'),
        subConds?: map[string][ DataExtraInfoSubCondsValue         ](name='SubConds'),
        subDbs?: map[string][ DataExtraInfoSubDbsValue         ](name='SubDbs'),
        subIds?: map[string]string(name='SubIds'),
        subtopics?: [ string ](name='Subtopics'),
        syncDelay?: long(name='SyncDelay', example='null'),
        syncDelaySampleTimestamp?: long(name='SyncDelaySampleTimestamp', example='1689214358'),
      }(name='ExtraInfo'),
      fullTransferConfig?: {
        allowDestTableNotEmpty?: boolean(name='AllowDestTableNotEmpty', example='false'),
        fullTransferSpeedMode?: string(name='FullTransferSpeedMode', example='NORMAL'),
        fullVerifySpeedMode?: string(name='FullVerifySpeedMode', example='NORMAL'),
        nonePkUkTruncateDstTable?: boolean(name='NonePkUkTruncateDstTable', example='false'),
      }(name='FullTransferConfig'),
      gmtCreate?: string(name='GmtCreate', example='2023-07-13T06:26:15'),
      gmtFinish?: string(name='GmtFinish', example='2023-07-13T08:01:27'),
      gmtModified?: string(name='GmtModified', example='2023-07-13T07:01:27'),
      gmtStart?: string(name='GmtStart', example='2023-07-13T07:02:27'),
      id?: string(name='Id', example='np_4w****'),
      importance?: string(name='Importance', example='MEDIUM'),
      incrTransferConfig?: {
        enableIncrSyncStatistics?: boolean(name='EnableIncrSyncStatistics', example='true'),
        enableSequencingWithinTxn?: boolean(name='EnableSequencingWithinTxn', example='true'),
        incrSyncConcurrency?: int32(name='IncrSyncConcurrency', example='64'),
        recordTypeWhiteList?: [ string ](name='RecordTypeWhiteList'),
        startTimestamp?: long(name='StartTimestamp', example='1681004708'),
        storeLogKeptHour?: int32(name='StoreLogKeptHour', example='24'),
      }(name='IncrTransferConfig'),
      isMerging?: boolean(name='IsMerging', example='false'),
      isModifying?: boolean(name='IsModifying', example='false'),
      isSubProject?: boolean(name='IsSubProject', example='false'),
      labels?: [ 
        {
          count?: int32(name='Count', example='2'),
          creator?: string(name='Creator', example='admin'),
          id?: string(name='Id', example='l_dfe****'),
          name?: string(name='Name', example='label_name'),
          type?: int32(name='Type', example='1'),
        }
      ](name='Labels'),
      name?: string(name='Name', example='project_name'),
      owner?: string(name='Owner', example='admin'),
      sinkConnectInfo?: {
        charset?: string(name='Charset', example='utf8mb4'),
        connExtraAttributes?: any(name='ConnExtraAttributes', example='null'),
        connectionInfo?: string(name='ConnectionInfo', example='null'),
        dbEngine?: string(name='DbEngine', example='MYSQL_PUBLIC'),
        endpointId?: string(name='EndpointId', example='e_4w3aic***'),
        endpointName?: string(name='EndpointName', example='ation129***9apimysql5616****'),
        endpointSide?: string(name='EndpointSide', example='sink'),
        host?: string(name='Host', example='xxx.xxx.xxx.1'),
        id?: string(name='Id', example='c_4w3akx***'),
        nlsLengthSemantics?: string(name='NlsLengthSemantics', example='null'),
        ocpName?: string(name='OcpName', example='null'),
        operatingSystem?: string(name='OperatingSystem', example='Linux'),
        owner?: string(name='Owner', description='Owner。', example='admin'),
        port?: int32(name='Port', example='2883'),
        region?: string(name='Region', example='cn-hangzhou'),
        resourceOwner?: string(name='ResourceOwner', example='1325847***'),
        timezone?: string(name='Timezone', example='+08:00'),
        username?: string(name='Username', example='oms**obmys**'),
        version?: string(name='Version', example='2.2.77'),
      }(name='SinkConnectInfo'),
      sinkEndpointType?: string(name='SinkEndpointType', example='OB_MYSQL'),
      sourceConnectInfo?: {
        charset?: string(name='Charset', example='utf8mb4'),
        connExtraAttributes?: any(name='ConnExtraAttributes', example='null'),
        connectionInfo?: string(name='ConnectionInfo', example='null'),
        dbEngine?: string(name='DbEngine', example='OB_MYSQL_PUBLIC'),
        endpointId?: string(name='EndpointId', example='e_4w3al***'),
        endpointName?: string(name='EndpointName', example='ration12****0obmysql4116892***'),
        endpointSide?: string(name='EndpointSide', example='source'),
        host?: string(name='Host', example='xxx.xxx.xxx.1'),
        id?: string(name='Id', example='c_4w3aq****'),
        nlsLengthSemantics?: string(name='NlsLengthSemantics', example='null'),
        ocpName?: string(name='OcpName', example='null'),
        operatingSystem?: string(name='OperatingSystem', example='Linux'),
        owner?: string(name='Owner', description='Owner。', example='admin'),
        port?: int32(name='Port', example='2883'),
        region?: string(name='Region', example='cn-hangzhou'),
        resourceOwner?: string(name='ResourceOwner', example='1325847***'),
        timezone?: string(name='Timezone', example='UTC'),
        username?: string(name='Username', example='oms931mys**'),
        version?: string(name='Version', example='5.7.27'),
      }(name='SourceConnectInfo'),
      sourceEndpointType?: string(name='SourceEndpointType', example='MYSQL'),
      status?: string(name='Status', example='RUNNING'),
      steps?: [ 
        {
          description?: string(name='Description'),
          extraInfo?: {
            errorCode?: string(name='ErrorCode', example='INNER_ERROR'),
            errorDetails?: [ 
              {
                code?: string(name='Code', example='CM-RESOAT1111'),
                extraContext?: map[string]any(name='ExtraContext'),
                level?: string(name='Level', example='ERROR'),
                message?: string(name='Message', example='A system error occurred.'),
                messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
                messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
                proposal?: string(name='Proposal', example='Contact the administrator.'),
                proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
                proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
                reason?: string(name='Reason', example='null'),
                reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
                reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
                upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
              }
            ](name='ErrorDetails'),
            errorMsg?: string(name='ErrorMsg', example='A system error occurred.'),
            errorParam?: map[string]string(name='ErrorParam'),
            failedTime?: string(name='FailedTime', example='null'),
          }(name='ExtraInfo'),
          finishTime?: string(name='FinishTime', example='2020-05-22T17:05:18'),
          name?: string(name='Name', example='TRANSFER_PRECHECK'),
          order?: int32(name='Order', example='1'),
          progress?: int32(name='Progress', example='100'),
          startTime?: string(name='StartTime', example='2020-05-22T17:04:18'),
          status?: string(name='Status', example='RUNNING'),
          stepInfo?: map[string]any(name='StepInfo', example='null'),
        }
      ](name='Steps'),
      structTransferConfig?: {
        byteCharConvertStrategy?: string(name='ByteCharConvertStrategy', example='DO_NOTHING_IF_BYTE_USED'),
        deferIndexCreation?: boolean(name='DeferIndexCreation', example='false'),
      }(name='StructTransferConfig'),
      transferMapping?: {
        mode?: string(name='Mode', example='SPECIFIC'),
      }(name='TransferMapping'),
      type?: string(name='Type', example='MIGRATION'),
      workerGradeId?: string(name='WorkerGradeId', example='g_i4wa7XXX'),
      workerGradeInfo?: {
        autoRenewal?: boolean(name='AutoRenewal'),
        chargeType?: string(name='ChargeType'),
        destRegion?: string(name='DestRegion'),
        destType?: string(name='DestType'),
        endTime?: string(name='EndTime'),
        expired?: boolean(name='Expired'),
        gmtCreate?: string(name='GmtCreate'),
        grade?: string(name='Grade'),
        id?: string(name='Id'),
        name?: string(name='Name'),
        sourceRegion?: string(name='SourceRegion'),
        sourceType?: string(name='SourceType'),
        spec?: string(name='Spec'),
        specName?: string(name='SpecName'),
      }(name='WorkerGradeInfo'),
    }
  ](name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='4'),
}

model ListProjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectsResponseBody(name='body'),
}

/**
 * @summary 查询项目列表
 *
 * @param tmpReq ListProjectsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectsResponse
 */
async function listProjectsWithOptions(tmpReq: ListProjectsRequest, runtime: Util.RuntimeOptions): ListProjectsResponse {
  Util.validateModel(tmpReq);
  var request = new ListProjectsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.labelIds)) {
    request.labelIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.labelIds, 'LabelIds', 'json');
  }
  if (!Util.isUnset(tmpReq.sinkEndpointTypes)) {
    request.sinkEndpointTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sinkEndpointTypes, 'SinkEndpointTypes', 'json');
  }
  if (!Util.isUnset(tmpReq.sourceEndpointTypes)) {
    request.sourceEndpointTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sourceEndpointTypes, 'SourceEndpointTypes', 'json');
  }
  if (!Util.isUnset(tmpReq.status)) {
    request.statusShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.status, 'Status', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.labelIdsShrink)) {
    body['LabelIds'] = request.labelIdsShrink;
  }
  if (!Util.isUnset(request.needRelatedInfo)) {
    body['NeedRelatedInfo'] = request.needRelatedInfo;
  }
  if (!Util.isUnset(request.order)) {
    body['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.searchKey)) {
    body['SearchKey'] = request.searchKey;
  }
  if (!Util.isUnset(request.sinkEndpointTypesShrink)) {
    body['SinkEndpointTypes'] = request.sinkEndpointTypesShrink;
  }
  if (!Util.isUnset(request.sortField)) {
    body['SortField'] = request.sortField;
  }
  if (!Util.isUnset(request.sourceEndpointTypesShrink)) {
    body['SourceEndpointTypes'] = request.sourceEndpointTypesShrink;
  }
  if (!Util.isUnset(request.statusShrink)) {
    body['Status'] = request.statusShrink;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.visibleSubProject)) {
    body['VisibleSubProject'] = request.visibleSubProject;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListProjects',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询项目列表
 *
 * @param request ListProjectsRequest
 * @return ListProjectsResponse
 */
async function listProjects(request: ListProjectsRequest): ListProjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listProjectsWithOptions(request, runtime);
}

model ListWorkerInstancesRequest {
  destType?: string(name='DestType', example='KAFKA'),
  instanceName?: string(name='InstanceName', example='i4katz****'),
  onlyBindable?: boolean(name='OnlyBindable', example='true'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sourceType?: string(name='SourceType', example='OCEANBASE'),
  specs?: [ string ](name='Specs'),
}

model ListWorkerInstancesShrinkRequest {
  destType?: string(name='DestType', example='KAFKA'),
  instanceName?: string(name='InstanceName', example='i4katz****'),
  onlyBindable?: boolean(name='OnlyBindable', example='true'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sourceType?: string(name='SourceType', example='OCEANBASE'),
  specsShrink?: string(name='Specs'),
}

model ListWorkerInstancesResponseBody = {
  advice?: string(name='Advice', example='null'),
  code?: string(name='Code', example='200'),
  cost?: string(name='Cost', example='71'),
  data?: [ 
    {
      gmtCreate?: string(name='GmtCreate', example='2023-07-14T20:49:53'),
      id?: string(name='Id', example='g_i4katzv***'),
      name?: string(name='Name', example='i4wa71k****'),
      projectId?: string(name='ProjectId', example='np_4kb18w****'),
      projectName?: string(name='ProjectName', example='j_migration_cloud-kafkavpc-ob'),
      projectType?: string(name='ProjectType', example='MIGRATION'),
      region?: string(name='Region', example='null'),
      spec?: string(name='Spec', example='oms.g2m.small'),
      status?: string(name='Status', example='ONLINE'),
    }
  ](name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='200'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='FATAL'),
    message?: string(name='Message', example='successful'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='successful'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='237'),
}

model ListWorkerInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkerInstancesResponseBody(name='body'),
}

/**
 * @summary 查询传输实例列表
 *
 * @param tmpReq ListWorkerInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWorkerInstancesResponse
 */
async function listWorkerInstancesWithOptions(tmpReq: ListWorkerInstancesRequest, runtime: Util.RuntimeOptions): ListWorkerInstancesResponse {
  Util.validateModel(tmpReq);
  var request = new ListWorkerInstancesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.specs)) {
    request.specsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.specs, 'Specs', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.destType)) {
    body['DestType'] = request.destType;
  }
  if (!Util.isUnset(request.instanceName)) {
    body['InstanceName'] = request.instanceName;
  }
  if (!Util.isUnset(request.onlyBindable)) {
    body['OnlyBindable'] = request.onlyBindable;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sourceType)) {
    body['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.specsShrink)) {
    body['Specs'] = request.specsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListWorkerInstances',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询传输实例列表
 *
 * @param request ListWorkerInstancesRequest
 * @return ListWorkerInstancesResponse
 */
async function listWorkerInstances(request: ListWorkerInstancesRequest): ListWorkerInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listWorkerInstancesWithOptions(request, runtime);
}

model ModifyDatabaseDescriptionRequest {
  databaseName?: string(name='DatabaseName', description='Example 1

This parameter is required.', example='sms_pre'),
  description?: string(name='Description', description='This parameter is required.', example='this is a test database'),
  instanceId?: string(name='InstanceId', description='The description of the database.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The operation that you want to perform.   
Set the value to **ModifyDatabaseDescription**.

This parameter is required.', example='ob2mr3oae0****'),
}

model ModifyDatabaseDescriptionResponseBody = {
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model ModifyDatabaseDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDatabaseDescriptionResponseBody(name='body'),
}

/**
 * @summary The request ID.
 *
 * @param request ModifyDatabaseDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDatabaseDescriptionResponse
 */
async function modifyDatabaseDescriptionWithOptions(request: ModifyDatabaseDescriptionRequest, runtime: Util.RuntimeOptions): ModifyDatabaseDescriptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.databaseName)) {
    body['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDatabaseDescription',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The request ID.
 *
 * @param request ModifyDatabaseDescriptionRequest
 * @return ModifyDatabaseDescriptionResponse
 */
async function modifyDatabaseDescription(request: ModifyDatabaseDescriptionRequest): ModifyDatabaseDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDatabaseDescriptionWithOptions(request, runtime);
}

model ModifyDatabaseUserRolesRequest {
  databaseName?: string(name='DatabaseName', description='The ID of the tenant.

This parameter is required.', example='sms_pre'),
  instanceId?: string(name='InstanceId', description='The account information.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='A list of usernames and their respective roles.

This parameter is required.', example='ob2mr3oae0****'),
  users?: string(name='Users', description='The ID of the OceanBase cluster.

This parameter is required.', example='[{"UserName":"omstest","Role":"readwrite"}]'),
}

model ModifyDatabaseUserRolesResponseBody = {
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenantUser?: {
    databaseName?: string(name='DatabaseName', description='Example 1', example='sms_pre'),
    tenantId?: string(name='TenantId', example='t33h8y08k****'),
    users?: [ 
      {
        role?: string(name='Role', example='ReadOnly'),
        userName?: string(name='UserName', example='user_pay_ro'),
      }
    ](name='Users'),
  }(name='TenantUser', description='The name of the database.'),
}

model ModifyDatabaseUserRolesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDatabaseUserRolesResponseBody(name='body'),
}

/**
 * @summary The accounts that have privileges on the database.
 *
 * @param request ModifyDatabaseUserRolesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDatabaseUserRolesResponse
 */
async function modifyDatabaseUserRolesWithOptions(request: ModifyDatabaseUserRolesRequest, runtime: Util.RuntimeOptions): ModifyDatabaseUserRolesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.databaseName)) {
    body['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.users)) {
    body['Users'] = request.users;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDatabaseUserRoles',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The accounts that have privileges on the database.
 *
 * @param request ModifyDatabaseUserRolesRequest
 * @return ModifyDatabaseUserRolesResponse
 */
async function modifyDatabaseUserRoles(request: ModifyDatabaseUserRolesRequest): ModifyDatabaseUserRolesResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDatabaseUserRolesWithOptions(request, runtime);
}

model ModifyInstanceNameRequest {
  instanceId?: string(name='InstanceId', description='It is an Alibaba Cloud asset management and configuration tool, with which you can manage multiple Alibaba Cloud products and services by using commands. It is easy to use and a good helper in migration to cloud.

This parameter is required.', example='ob317v4uif****'),
  instanceName?: string(name='InstanceName', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob4prod'),
}

model ModifyInstanceNameResponseBody = {
  requestId?: string(name='RequestId', description='The operation that you want to perform.   
Set the value to **ModifyInstanceName**.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model ModifyInstanceNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceNameResponseBody(name='body'),
}

/**
 * @summary The name of the OceanBase cluster.
 *
 * @param request ModifyInstanceNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceNameResponse
 */
async function modifyInstanceNameWithOptions(request: ModifyInstanceNameRequest, runtime: Util.RuntimeOptions): ModifyInstanceNameResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceName)) {
    body['InstanceName'] = request.instanceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceName',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The name of the OceanBase cluster.
 *
 * @param request ModifyInstanceNameRequest
 * @return ModifyInstanceNameResponse
 */
async function modifyInstanceName(request: ModifyInstanceNameRequest): ModifyInstanceNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceNameWithOptions(request, runtime);
}

model ModifyInstanceNodeNumRequest {
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run for the request. Default value: false. Valid values:
- true: Only a dry-run request is sent and the number of nodes in the instance is not modified. If the dry run succeeds, DryRunResult=true is returned. If the dry run fails, an error code is returned.
- false: The actual request is sent and no dry run is performed. The number of nodes is changed if the requirements are met. By default, the DryRunResult parameter returns false if you set DryRun to false.', example='true'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  nodeNum?: string(name='NodeNum', description='The number of nodes in the cluster. If the cluster is deployed in n-n-n mode, the number of nodes in the cluster equals n × 3.

This parameter is required.', example='6'),
}

model ModifyInstanceNodeNumResponseBody = {
  data?: {
    dryRunResult?: boolean(name='DryRunResult', description='The result of the dry-run request.
- If the DryRun parameter is set to true and the dry run succeeds, the DryRunResult parameter returns true. Otherwise, an error code is returned.
- If the DryRun parameter is set to false, no dry run is performed and the DryRunResult parameter returns false.', example='false'),
    orderId?: string(name='OrderId', description='The ID of the order.', example='2132903*********'),
  }(name='Data', description='The return result of the request.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model ModifyInstanceNodeNumResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceNodeNumResponseBody(name='body'),
}

/**
 * @summary You can call this operation to modify the number of nodes in a cluster.
 *
 * @param request ModifyInstanceNodeNumRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceNodeNumResponse
 */
async function modifyInstanceNodeNumWithOptions(request: ModifyInstanceNodeNumRequest, runtime: Util.RuntimeOptions): ModifyInstanceNodeNumResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.nodeNum)) {
    body['NodeNum'] = request.nodeNum;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceNodeNum',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to modify the number of nodes in a cluster.
 *
 * @param request ModifyInstanceNodeNumRequest
 * @return ModifyInstanceNodeNumResponse
 */
async function modifyInstanceNodeNum(request: ModifyInstanceNodeNumRequest): ModifyInstanceNodeNumResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceNodeNumWithOptions(request, runtime);
}

model ModifyInstanceSSLRequest {
  enableSSL?: string(name='EnableSSL', description='The operation to modify the SSL status. Valid values:

- open: Enable SSL encryption.

- update: Update the CA certificate.

- close: Disable SSL encryption.

This parameter is required.', example='open'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId'),
}

model ModifyInstanceSSLResponseBody = {
  instanceSSL?: {
    enableSSL?: string(name='EnableSSL', description='The operation to modify the SSL status. Valid values:

- open: Enable SSL encryption.

- update: Update the CA certificate.

- close: Disable SSL encryption.', example='open'),
    instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
    tenantId?: string(name='TenantId'),
  }(name='InstanceSSL', description='The SSL setting of the OceanBase cluster instance.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model ModifyInstanceSSLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceSSLResponseBody(name='body'),
}

/**
 * @summary You can call this operation to modify the Secure Sockets Layer (SSL) setting for an OceanBase cluster instance.
 *
 * @description There is currently no authorization information disclosed in the API.
 *
 * @param request ModifyInstanceSSLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceSSLResponse
 */
async function modifyInstanceSSLWithOptions(request: ModifyInstanceSSLRequest, runtime: Util.RuntimeOptions): ModifyInstanceSSLResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.enableSSL)) {
    body['EnableSSL'] = request.enableSSL;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceSSL',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to modify the Secure Sockets Layer (SSL) setting for an OceanBase cluster instance.
 *
 * @description There is currently no authorization information disclosed in the API.
 *
 * @param request ModifyInstanceSSLRequest
 * @return ModifyInstanceSSLResponse
 */
async function modifyInstanceSSL(request: ModifyInstanceSSLRequest): ModifyInstanceSSLResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceSSLWithOptions(request, runtime);
}

model ModifyInstanceSpecRequest {
  diskSize?: long(name='DiskSize', description='The size of the storage space, in GB. The required storage space varies based on the cluster specifications:
- 8C32G: 100 GB to 10 TB.
- 14C70G: 200 GB to 10 TB.
- 30C180G: 400 GB to 10 TB.
- 62C400G: 800 GB to 10 TB. The preceding minimum storage space sizes are the default storage space sizes of the corresponding cluster specification plans.', example='200'),
  diskType?: string(name='DiskType', description='Disk type.', example='cloud_essd_pl1'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform only a dry run for the request. Default value: false. Valid values:
- true: Only a dry-run request is sent and the instance settings are not modified. If the dry run succeeds, DryRunResult=true is returned. If the dry run fails, an error code is returned.
- false: If the DryRun parameter is set to false, no dry run is performed and the DryRunResult parameter returns false.', example='false'),
  instanceClass?: string(name='InstanceClass', description='The specifications of the cluster. You can specify one of the following four plans:
- 8C32GB: indicates 8 CPU cores and 32 GB of memory.
- 14C70GB: indicates 14 CPU cores and 70 GB of memory. This is the default value.
- 30C180GB: indicates 30 CPU cores and 180 GB of memory.
- 62C400GB: indicates 62 CPU cores and 400 GB of memory.', example='14C70GB'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob3h8ytroxxxxx'),
  upgradeSpecNative?: boolean(name='UpgradeSpecNative'),
}

model ModifyInstanceSpecResponseBody = {
  data?: {
    dryRunResult?: boolean(name='DryRunResult', description='The result of the dry-run request.
- If the DryRun parameter is set to true and the dry run succeeds, the DryRunResult parameter returns true. Otherwise, an error code is returned.
- If the DryRun parameter is set to false, no dry run is performed and the DryRunResult parameter returns false.', example='false'),
    orderId?: string(name='OrderId', description='The ID of the order that you have placed.', example='213290*********'),
  }(name='Data', description='The return data of the request.', example='1234567890'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model ModifyInstanceSpecResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceSpecResponseBody(name='body'),
}

/**
 * @summary You can call this operation to modify the cluster specifications and storage space.
 *
 * @param request ModifyInstanceSpecRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceSpecResponse
 */
async function modifyInstanceSpecWithOptions(request: ModifyInstanceSpecRequest, runtime: Util.RuntimeOptions): ModifyInstanceSpecResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.diskSize)) {
    body['DiskSize'] = request.diskSize;
  }
  if (!Util.isUnset(request.diskType)) {
    body['DiskType'] = request.diskType;
  }
  if (!Util.isUnset(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.instanceClass)) {
    body['InstanceClass'] = request.instanceClass;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.upgradeSpecNative)) {
    body['UpgradeSpecNative'] = request.upgradeSpecNative;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceSpec',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to modify the cluster specifications and storage space.
 *
 * @param request ModifyInstanceSpecRequest
 * @return ModifyInstanceSpecResponse
 */
async function modifyInstanceSpec(request: ModifyInstanceSpecRequest): ModifyInstanceSpecResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceSpecWithOptions(request, runtime);
}

model ModifyInstanceTagsRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tags?: string(name='Tags', description='The tags.

This parameter is required.', example='[{"Key": "xxx", "Value", "xxx"},{}]'),
}

model ModifyInstanceTagsResponseBody = {
  message?: string(name='Message', description='The tag modification result.', example='done'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model ModifyInstanceTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceTagsResponseBody(name='body'),
}

/**
 * @summary You can call this operation to modify the tags of a cluster.
 *
 * @param request ModifyInstanceTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceTagsResponse
 */
async function modifyInstanceTagsWithOptions(request: ModifyInstanceTagsRequest, runtime: Util.RuntimeOptions): ModifyInstanceTagsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tags)) {
    body['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceTags',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to modify the tags of a cluster.
 *
 * @param request ModifyInstanceTagsRequest
 * @return ModifyInstanceTagsResponse
 */
async function modifyInstanceTags(request: ModifyInstanceTagsRequest): ModifyInstanceTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceTagsWithOptions(request, runtime);
}

model ModifyInstanceTemporaryCapacityRequest {
  acceptLanguage?: string(name='AcceptLanguage', example='zh-CN'),
  diskSize?: string(name='DiskSize', description='The disk size. Unit: GB.', example='400'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  spec?: string(name='Spec', description='Specification.

This parameter is required.', example='oceanbase.cluster.i2.small'),
}

model ModifyInstanceTemporaryCapacityResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model ModifyInstanceTemporaryCapacityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceTemporaryCapacityResponseBody(name='body'),
}

/**
 * @summary You can call this operation to modify the temporary capacity of the OceanBase cluster.
 *
 * @param request ModifyInstanceTemporaryCapacityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceTemporaryCapacityResponse
 */
async function modifyInstanceTemporaryCapacityWithOptions(request: ModifyInstanceTemporaryCapacityRequest, runtime: Util.RuntimeOptions): ModifyInstanceTemporaryCapacityResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    body['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.diskSize)) {
    body['DiskSize'] = request.diskSize;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.spec)) {
    body['Spec'] = request.spec;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceTemporaryCapacity',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to modify the temporary capacity of the OceanBase cluster.
 *
 * @param request ModifyInstanceTemporaryCapacityRequest
 * @return ModifyInstanceTemporaryCapacityResponse
 */
async function modifyInstanceTemporaryCapacity(request: ModifyInstanceTemporaryCapacityRequest): ModifyInstanceTemporaryCapacityResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceTemporaryCapacityWithOptions(request, runtime);
}

model ModifyParametersRequest {
  dimension?: string(name='Dimension', description='The ID of the OceanBase cluster.

This parameter is required.', example='TENANT'),
  dimensionValue?: string(name='DimensionValue', description='The cause of the modification failure.', example='ob2mr3oae0****'),
  instanceId?: string(name='InstanceId', description='Alibaba Cloud CLI

This parameter is required.', example='ob317v4uif****'),
  parameters?: string(name='Parameters', description='The resource ID of the parameter type.    
You can leave this parameter unspecified when you call this operation to modify cluster parameters. In the case of tenant parameters, pass the tenant ID.

This parameter is required.', example='[{"Name":"connect_timeout","Value":"20"}]'),
}

model ModifyParametersResponseBody = {
  requestId?: string(name='RequestId', description='The operation that you want to perform.   
Set the value to **ModifyParameters**.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  results?: {
    message?: string(name='Message', example='schedule timeout.'),
    success?: boolean(name='Success', example='false'),
  }(name='Results', description='Example 1'),
}

model ModifyParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyParametersResponseBody(name='body'),
}

/**
 * @summary The modification results.
 *
 * @param request ModifyParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyParametersResponse
 */
async function modifyParametersWithOptions(request: ModifyParametersRequest, runtime: Util.RuntimeOptions): ModifyParametersResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dimension)) {
    body['Dimension'] = request.dimension;
  }
  if (!Util.isUnset(request.dimensionValue)) {
    body['DimensionValue'] = request.dimensionValue;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.parameters)) {
    body['Parameters'] = request.parameters;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyParameters',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The modification results.
 *
 * @param request ModifyParametersRequest
 * @return ModifyParametersResponse
 */
async function modifyParameters(request: ModifyParametersRequest): ModifyParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyParametersWithOptions(request, runtime);
}

model ModifySecurityIpsRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  securityIpGroupName?: string(name='SecurityIpGroupName', description='The information of the IP address whitelist group.', example='paytest'),
  securityIps?: string(name='SecurityIps', description='The list of IP addresses and CIDR blocks in the whitelist.   
It is a JSON array. Each object in the array is an IP address or CIDR block. You can specify at most 40 IP addresses or CIDR blocks.', example='["192.168.0.0/20","192.169.1.1"]'),
}

model ModifySecurityIpsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  securityIpGroup?: {
    instanceId?: string(name='InstanceId', example='ob317v4uif****'),
    securityIpGroupName?: string(name='SecurityIpGroupName', example='online_paycore'),
    securityIps?: string(name='SecurityIps', example='121.41.106.33,100.104.7.0/26'),
  }(name='SecurityIpGroup', description='Example 1'),
}

model ModifySecurityIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySecurityIpsResponseBody(name='body'),
}

/**
 * @summary The name of the security group.
 *
 * @param request ModifySecurityIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySecurityIpsResponse
 */
async function modifySecurityIpsWithOptions(request: ModifySecurityIpsRequest, runtime: Util.RuntimeOptions): ModifySecurityIpsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.securityIpGroupName)) {
    body['SecurityIpGroupName'] = request.securityIpGroupName;
  }
  if (!Util.isUnset(request.securityIps)) {
    body['SecurityIps'] = request.securityIps;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifySecurityIps',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The name of the security group.
 *
 * @param request ModifySecurityIpsRequest
 * @return ModifySecurityIpsResponse
 */
async function modifySecurityIps(request: ModifySecurityIpsRequest): ModifySecurityIpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySecurityIpsWithOptions(request, runtime);
}

model ModifyTagNameRequest {
  key?: string(name='Key', description='The name of the tag group.

This parameter is required.', example='Tag group 1'),
  newKey?: string(name='NewKey', description='The new name of the tag group.

This parameter is required.', example='Tag group 2'),
}

model ModifyTagNameResponseBody = {
  message?: string(name='Message', description='The tag group renaming result.', example='update tag name success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4C91F7BA-xxxx-xxxx-xxxx-846ECA1A9908'),
}

model ModifyTagNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTagNameResponseBody(name='body'),
}

/**
 * @param request ModifyTagNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTagNameResponse
 */
async function modifyTagNameWithOptions(request: ModifyTagNameRequest, runtime: Util.RuntimeOptions): ModifyTagNameResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.key)) {
    body['Key'] = request.key;
  }
  if (!Util.isUnset(request.newKey)) {
    body['NewKey'] = request.newKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTagName',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyTagNameRequest
 * @return ModifyTagNameResponse
 */
async function modifyTagName(request: ModifyTagNameRequest): ModifyTagNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTagNameWithOptions(request, runtime);
}

model ModifyTagValueNameRequest {
  key?: string(name='Key', description='The name of the tag group.

This parameter is required.', example='Tag group 1'),
  newValue?: string(name='NewValue', description='The new name of the tag.

This parameter is required.', example='Tag 2'),
  value?: string(name='Value', description='The name of the tag.

This parameter is required.', example='Tag 1'),
}

model ModifyTagValueNameResponseBody = {
  message?: string(name='Message', description='The tag renaming result.', example='update tag-value name success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4C91F7BA-xxxx-xxxx-xxxx-846ECA1A9908'),
}

model ModifyTagValueNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTagValueNameResponseBody(name='body'),
}

/**
 * @summary You can call this operation to rename a tag.
 *
 * @param request ModifyTagValueNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTagValueNameResponse
 */
async function modifyTagValueNameWithOptions(request: ModifyTagValueNameRequest, runtime: Util.RuntimeOptions): ModifyTagValueNameResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.key)) {
    body['Key'] = request.key;
  }
  if (!Util.isUnset(request.newValue)) {
    body['NewValue'] = request.newValue;
  }
  if (!Util.isUnset(request.value)) {
    body['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTagValueName',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to rename a tag.
 *
 * @param request ModifyTagValueNameRequest
 * @return ModifyTagValueNameResponse
 */
async function modifyTagValueName(request: ModifyTagValueNameRequest): ModifyTagValueNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTagValueNameWithOptions(request, runtime);
}

model ModifyTenantEncryptionRequest {
  encryptionKeyId?: string(name='EncryptionKeyId', example='key-shh322****470h8v0-g2ll85****'),
  encryptionType?: string(name='EncryptionType', description='This parameter is required.', example='EncryptionKey'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='This parameter is required.', example='ob2mr3oae0****'),
}

model ModifyTenantEncryptionResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  tenantEncryption?: {
    encryptionType?: string(name='EncryptionType', example='EncryptionKey'),
    instanceId?: string(name='InstanceId', example='ob317v4uif****'),
    tenantId?: string(name='TenantId', example='ob2mr3oae0****'),
  }(name='TenantEncryption', description='job'),
}

model ModifyTenantEncryptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTenantEncryptionResponseBody(name='body'),
}

/**
 * @summary 租户加密变更
 *
 * @param request ModifyTenantEncryptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTenantEncryptionResponse
 */
async function modifyTenantEncryptionWithOptions(request: ModifyTenantEncryptionRequest, runtime: Util.RuntimeOptions): ModifyTenantEncryptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.encryptionKeyId)) {
    body['EncryptionKeyId'] = request.encryptionKeyId;
  }
  if (!Util.isUnset(request.encryptionType)) {
    body['EncryptionType'] = request.encryptionType;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTenantEncryption',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 租户加密变更
 *
 * @param request ModifyTenantEncryptionRequest
 * @return ModifyTenantEncryptionResponse
 */
async function modifyTenantEncryption(request: ModifyTenantEncryptionRequest): ModifyTenantEncryptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTenantEncryptionWithOptions(request, runtime);
}

model ModifyTenantPrimaryZoneRequest {
  instanceId?: string(name='InstanceId', description='The primary zone of the tenant.    
It is one of the zones in which the cluster is deployed.

This parameter is required.', example='ob317v4uif****'),
  masterIntranetAddressZone?: string(name='MasterIntranetAddressZone', description='```
http(s)://[Endpoint]/?Action=ModifyTenantPrimaryZone
&TenantId=ob2mr3oae0****
&InstanceId=ob317v4uif****
&PrimaryZone=cn-hangzhou-h
&Common request parameters
```', example='cn-hangzhou-h'),
  primaryZone?: string(name='PrimaryZone', description='The ID of the vSwitch.', example='cn-hangzhou-h'),
  tenantEndpointDirectId?: string(name='TenantEndpointDirectId'),
  tenantEndpointId?: string(name='TenantEndpointId', example='obe-4tw51gp7****'),
  tenantId?: string(name='TenantId', description='The return result of the request.

This parameter is required.', example='ob2mr3oae0****'),
  userDirectVSwitchId?: string(name='UserDirectVSwitchId'),
  userVSwitchId?: string(name='UserVSwitchId', description='The request ID.', example='vsw-xxx'),
  userVpcOwnerId?: string(name='UserVpcOwnerId'),
  vpcId?: string(name='VpcId'),
}

model ModifyTenantPrimaryZoneResponseBody = {
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model ModifyTenantPrimaryZoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTenantPrimaryZoneResponseBody(name='body'),
}

/**
 * @summary The return result of the request.
 *
 * @param request ModifyTenantPrimaryZoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTenantPrimaryZoneResponse
 */
async function modifyTenantPrimaryZoneWithOptions(request: ModifyTenantPrimaryZoneRequest, runtime: Util.RuntimeOptions): ModifyTenantPrimaryZoneResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.masterIntranetAddressZone)) {
    body['MasterIntranetAddressZone'] = request.masterIntranetAddressZone;
  }
  if (!Util.isUnset(request.primaryZone)) {
    body['PrimaryZone'] = request.primaryZone;
  }
  if (!Util.isUnset(request.tenantEndpointDirectId)) {
    body['TenantEndpointDirectId'] = request.tenantEndpointDirectId;
  }
  if (!Util.isUnset(request.tenantEndpointId)) {
    body['TenantEndpointId'] = request.tenantEndpointId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.userDirectVSwitchId)) {
    body['UserDirectVSwitchId'] = request.userDirectVSwitchId;
  }
  if (!Util.isUnset(request.userVSwitchId)) {
    body['UserVSwitchId'] = request.userVSwitchId;
  }
  if (!Util.isUnset(request.userVpcOwnerId)) {
    body['UserVpcOwnerId'] = request.userVpcOwnerId;
  }
  if (!Util.isUnset(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTenantPrimaryZone',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The return result of the request.
 *
 * @param request ModifyTenantPrimaryZoneRequest
 * @return ModifyTenantPrimaryZoneResponse
 */
async function modifyTenantPrimaryZone(request: ModifyTenantPrimaryZoneRequest): ModifyTenantPrimaryZoneResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTenantPrimaryZoneWithOptions(request, runtime);
}

model ModifyTenantResourceRequest {
  cpu?: int32(name='Cpu', description='The information about the CPU resources of the tenant.

This parameter is required.', example='2'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  logDisk?: long(name='LogDisk', description='The size of the log disk allocated to the tenant, in GB.', example='128'),
  memory?: int32(name='Memory', description='The memory size of the tenant, in GB.

This parameter is required.', example='2'),
  readOnlyZoneList?: string(name='ReadOnlyZoneList', description='Specifies to create a read-only zone. Separate the names of multiple zones with commas (,).', example='cn-shanghai-g-ro,cn-shanghai-h-ro', deprecated=true),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='ob2mr3oae0****'),
}

model ModifyTenantResourceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t33h8y08k****'),
}

model ModifyTenantResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTenantResourceResponseBody(name='body'),
}

/**
 * @summary You can call this operation to modify the specifications of a tenant in an OceanBase cluster.
 *
 * @param request ModifyTenantResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTenantResourceResponse
 */
async function modifyTenantResourceWithOptions(request: ModifyTenantResourceRequest, runtime: Util.RuntimeOptions): ModifyTenantResourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cpu)) {
    body['Cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.logDisk)) {
    body['LogDisk'] = request.logDisk;
  }
  if (!Util.isUnset(request.memory)) {
    body['Memory'] = request.memory;
  }
  if (!Util.isUnset(request.readOnlyZoneList)) {
    body['ReadOnlyZoneList'] = request.readOnlyZoneList;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTenantResource',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to modify the specifications of a tenant in an OceanBase cluster.
 *
 * @param request ModifyTenantResourceRequest
 * @return ModifyTenantResourceResponse
 */
async function modifyTenantResource(request: ModifyTenantResourceRequest): ModifyTenantResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTenantResourceWithOptions(request, runtime);
}

model ModifyTenantSecurityIpGroupRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  securityIpGroupName?: string(name='SecurityIpGroupName', description='The group name of the whitelist group of IP addresses.

It starts with lowercase letters and ends with lowercase letters or numbers. It can only contain lowercase letters, numbers, and underscores, and should be 2~32 characters in length.

This parameter is required.', example='paytest'),
  securityIps?: string(name='SecurityIps', description='The list of IP addresses in the whitelist group.

It is a JSON array. Each object in the array is an IP address or a CIDR block. You can have up to 40 whitelists.

This parameter is required.', example='192.***.*.*"'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t4louaeei****'),
}

model ModifyTenantSecurityIpGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  securityIpGroup?: {
    instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.', example='ob317v4uif****'),
    securityIpGroupName?: string(name='SecurityIpGroupName', description='The name of the whitelist group.', example='paytest'),
    securityIps?: string(name='SecurityIps', description='The list of IP addresses in the IP address whitelist group.

It is a string separated by commas, and each object is an IP address or a CIDR block.', example='192.***.*.*'),
    tenantId?: string(name='TenantId', description='The ID of the tenant.', example='t4louaeei****'),
  }(name='SecurityIpGroup', description='The information of the IP address whitelist group.'),
}

model ModifyTenantSecurityIpGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTenantSecurityIpGroupResponseBody(name='body'),
}

/**
 * @summary You can call this operation to modify the information on the whitelist group of the tenant.
 *
 * @param request ModifyTenantSecurityIpGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTenantSecurityIpGroupResponse
 */
async function modifyTenantSecurityIpGroupWithOptions(request: ModifyTenantSecurityIpGroupRequest, runtime: Util.RuntimeOptions): ModifyTenantSecurityIpGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.securityIpGroupName)) {
    body['SecurityIpGroupName'] = request.securityIpGroupName;
  }
  if (!Util.isUnset(request.securityIps)) {
    body['SecurityIps'] = request.securityIps;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTenantSecurityIpGroup',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to modify the information on the whitelist group of the tenant.
 *
 * @param request ModifyTenantSecurityIpGroupRequest
 * @return ModifyTenantSecurityIpGroupResponse
 */
async function modifyTenantSecurityIpGroup(request: ModifyTenantSecurityIpGroupRequest): ModifyTenantSecurityIpGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTenantSecurityIpGroupWithOptions(request, runtime);
}

model ModifyTenantTagsRequest {
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tags?: string(name='Tags', description='The tags.

This parameter is required.', example='[{"Key": "xxx", "Value", "xxx"}]'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='t33h8y08k****'),
}

model ModifyTenantTagsResponseBody = {
  message?: string(name='Message', description='The tag modification result.', example='done'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model ModifyTenantTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTenantTagsResponseBody(name='body'),
}

/**
 * @summary You can call this operation to modify the tags of a tenant.
 *
 * @param request ModifyTenantTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTenantTagsResponse
 */
async function modifyTenantTagsWithOptions(request: ModifyTenantTagsRequest, runtime: Util.RuntimeOptions): ModifyTenantTagsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tags)) {
    body['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTenantTags',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to modify the tags of a tenant.
 *
 * @param request ModifyTenantTagsRequest
 * @return ModifyTenantTagsResponse
 */
async function modifyTenantTags(request: ModifyTenantTagsRequest): ModifyTenantTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTenantTagsWithOptions(request, runtime);
}

model ModifyTenantUserDescriptionRequest {
  description?: string(name='Description', description='The operation that you want to perform.   
Set the value to **ModifyTenantUserDescription**.

This parameter is required.', example='this is a test database'),
  instanceId?: string(name='InstanceId', description='The ID of the OceanBase cluster.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='ob2mr3oae0****'),
  userName?: string(name='UserName', description='The description of the database.

This parameter is required.', example='pay_test'),
}

model ModifyTenantUserDescriptionResponseBody = {
  requestId?: string(name='RequestId', description='You can call this operation to modify the description of a specified account in a tenant.', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model ModifyTenantUserDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTenantUserDescriptionResponseBody(name='body'),
}

/**
 * @summary The description of the database.
 *
 * @param request ModifyTenantUserDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTenantUserDescriptionResponse
 */
async function modifyTenantUserDescriptionWithOptions(request: ModifyTenantUserDescriptionRequest, runtime: Util.RuntimeOptions): ModifyTenantUserDescriptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTenantUserDescription',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The description of the database.
 *
 * @param request ModifyTenantUserDescriptionRequest
 * @return ModifyTenantUserDescriptionResponse
 */
async function modifyTenantUserDescription(request: ModifyTenantUserDescriptionRequest): ModifyTenantUserDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTenantUserDescriptionWithOptions(request, runtime);
}

model ModifyTenantUserPasswordRequest {
  encryptionType?: string(name='EncryptionType', description='加密方式。', example='RSA'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='```
http(s)://[Endpoint]/?Action=ModifyTenantUserPassword
&UserName=pay_test
&TenantId=ob2mr3oae0****
&UserPassword=!Aliyun4Oceanbase
&InstanceId=ob317v4uif****
&Common request parameters
```

This parameter is required.', example='ob2mr3oae0****'),
  userName?: string(name='UserName', description='The ID of the OceanBase cluster.

This parameter is required.', example='pay_test'),
  userPassword?: string(name='UserPassword', description='You can call this operation to change the logon password of a specified account in a tenant.

This parameter is required.', example='!Aliyun4Oceanbase'),
}

model ModifyTenantUserPasswordResponseBody = {
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
}

model ModifyTenantUserPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTenantUserPasswordResponseBody(name='body'),
}

/**
 * @summary The request ID.
 *
 * @param request ModifyTenantUserPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTenantUserPasswordResponse
 */
async function modifyTenantUserPasswordWithOptions(request: ModifyTenantUserPasswordRequest, runtime: Util.RuntimeOptions): ModifyTenantUserPasswordResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.encryptionType)) {
    body['EncryptionType'] = request.encryptionType;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  if (!Util.isUnset(request.userPassword)) {
    body['UserPassword'] = request.userPassword;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTenantUserPassword',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The request ID.
 *
 * @param request ModifyTenantUserPasswordRequest
 * @return ModifyTenantUserPasswordResponse
 */
async function modifyTenantUserPassword(request: ModifyTenantUserPasswordRequest): ModifyTenantUserPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTenantUserPasswordWithOptions(request, runtime);
}

model ModifyTenantUserRolesRequest {
  globalPermissions?: string(name='GlobalPermissions'),
  instanceId?: string(name='InstanceId', description='The type of the privilege modification operation.   
Valid values:  
update: updates all privileges. This is the default value.  
add: adds a privilege.  
delete: deletes a privilege.

This parameter is required.', example='ob317v4uif****'),
  modifyType?: string(name='ModifyType', description='The name of the table.', example='update'),
  tenantId?: string(name='TenantId', description='The operation that you want to perform.   
Set the value to **ModifyTenantUserRoles**.

This parameter is required.', example='ob2mr3oae0****'),
  userName?: string(name='UserName', description='The role of the database account.

This parameter is required.', example='pay_test'),
  userRole?: string(name='UserRole', description='The type of the account. Valid values:   
- Admin: the super administrator account.   
- Normal: a general account.

This parameter is required.', example='[{"Database":"20210824160559","Role":"readwrite"}]'),
  userType?: string(name='UserType', example='Normal'),
}

model ModifyTenantUserRolesResponseBody = {
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenantUser?: {
    tenantId?: string(name='TenantId', example='t33h8y08k****'),
    userName?: string(name='UserName', example='pay_test'),
    userRole?: [ 
      {
        database?: string(name='Database', description='```
http(s)://[Endpoint]/?Action=ModifyTenantUserRoles
&UserName=pay_test
&TenantId=ob2mr3oae0****
&UserRole=[{"Database":"20210824160559","Role":"readwrite"}]
&InstanceId=ob317v4uif****
&ModifyType=update
&Common request parameters
```', example='db_pay1'),
        isSuccess?: boolean(name='IsSuccess', example='true'),
        role?: string(name='Role', description='You can call this operation to modify the database privileges of a specified account in a tenant.', example='ReadOnly'),
        table?: string(name='Table', example='tbl_pay1'),
      }
    ](name='UserRole', description='The name of the database (MySQL mode) or schema (Oracle mode).', example='账号具备的数据库权限信息列表。'),
  }(name='TenantUser', description='The ID of the tenant.'),
}

model ModifyTenantUserRolesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTenantUserRolesResponseBody(name='body'),
}

/**
 * @summary Indicates whether the privilege was granted to the role.
 *
 * @param request ModifyTenantUserRolesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTenantUserRolesResponse
 */
async function modifyTenantUserRolesWithOptions(request: ModifyTenantUserRolesRequest, runtime: Util.RuntimeOptions): ModifyTenantUserRolesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.globalPermissions)) {
    body['GlobalPermissions'] = request.globalPermissions;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.modifyType)) {
    body['ModifyType'] = request.modifyType;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  if (!Util.isUnset(request.userRole)) {
    body['UserRole'] = request.userRole;
  }
  if (!Util.isUnset(request.userType)) {
    body['UserType'] = request.userType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTenantUserRoles',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Indicates whether the privilege was granted to the role.
 *
 * @param request ModifyTenantUserRolesRequest
 * @return ModifyTenantUserRolesResponse
 */
async function modifyTenantUserRoles(request: ModifyTenantUserRolesRequest): ModifyTenantUserRolesResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTenantUserRolesWithOptions(request, runtime);
}

model ModifyTenantUserStatusRequest {
  instanceId?: string(name='InstanceId', description='The operation that you want to perform.   
Set the value to **ModifyTenantUserStatus**.

This parameter is required.', example='ob317v4uif****'),
  tenantId?: string(name='TenantId', description='The ID of the tenant.

This parameter is required.', example='ob2mr3oae0****'),
  userName?: string(name='UserName', description='The list of database accounts in the tenant.

This parameter is required.', example='pay_test'),
  userStatus?: string(name='UserStatus', description='The status of the database account. Valid values:   
- Locked: The account is locked. 
- Online: The account is unlocked.

This parameter is required.', example='The ID of the tenant.'),
}

model ModifyTenantUserStatusResponseBody = {
  requestId?: string(name='RequestId', description='Example 1', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  tenantUser?: [ 
    {
      tenantId?: string(name='TenantId', example='t33h8y08k****'),
      userName?: string(name='UserName', example='pay_test'),
      userStatus?: string(name='UserStatus', example='LOCKED'),
    }
  ](name='TenantUser'),
}

model ModifyTenantUserStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTenantUserStatusResponseBody(name='body'),
}

/**
 * @summary The ID of the tenant.
 *
 * @param request ModifyTenantUserStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTenantUserStatusResponse
 */
async function modifyTenantUserStatusWithOptions(request: ModifyTenantUserStatusRequest, runtime: Util.RuntimeOptions): ModifyTenantUserStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.userName)) {
    body['UserName'] = request.userName;
  }
  if (!Util.isUnset(request.userStatus)) {
    body['UserStatus'] = request.userStatus;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTenantUserStatus',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary The ID of the tenant.
 *
 * @param request ModifyTenantUserStatusRequest
 * @return ModifyTenantUserStatusResponse
 */
async function modifyTenantUserStatus(request: ModifyTenantUserStatusRequest): ModifyTenantUserStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTenantUserStatusWithOptions(request, runtime);
}

model ReleaseProjectRequest {
  id?: string(name='Id', description='This parameter is required.', example='np_4w3a****'),
}

model ReleaseProjectResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: any(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='50'),
}

model ReleaseProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseProjectResponseBody(name='body'),
}

/**
 * @summary 释放项目
 *
 * @param request ReleaseProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseProjectResponse
 */
async function releaseProjectWithOptions(request: ReleaseProjectRequest, runtime: Util.RuntimeOptions): ReleaseProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseProject',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 释放项目
 *
 * @param request ReleaseProjectRequest
 * @return ReleaseProjectResponse
 */
async function releaseProject(request: ReleaseProjectRequest): ReleaseProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseProjectWithOptions(request, runtime);
}

model ReleaseWorkerInstanceRequest {
  id?: string(name='Id', description='This parameter is required.', example='g_abcdefj***'),
}

model ReleaseWorkerInstanceResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='30'),
  data?: string(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model ReleaseWorkerInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseWorkerInstanceResponseBody(name='body'),
}

/**
 * @summary 释放传输实例 （未绑定项目时才可以释放）
 *
 * @param request ReleaseWorkerInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseWorkerInstanceResponse
 */
async function releaseWorkerInstanceWithOptions(request: ReleaseWorkerInstanceRequest, runtime: Util.RuntimeOptions): ReleaseWorkerInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseWorkerInstance',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 释放传输实例 （未绑定项目时才可以释放）
 *
 * @param request ReleaseWorkerInstanceRequest
 * @return ReleaseWorkerInstanceResponse
 */
async function releaseWorkerInstance(request: ReleaseWorkerInstanceRequest): ReleaseWorkerInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseWorkerInstanceWithOptions(request, runtime);
}

model RemoveStandbyInstanceRequest {
  forced?: boolean(name='Forced', example='false'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='ob608fgj1q****'),
  targetInstanceId?: string(name='TargetInstanceId', description='This parameter is required.', example='ob4bv8o7sp****'),
}

model RemoveStandbyInstanceResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
}

model RemoveStandbyInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveStandbyInstanceResponseBody(name='body'),
}

/**
 * @summary 备实例解耦
 *
 * @param request RemoveStandbyInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveStandbyInstanceResponse
 */
async function removeStandbyInstanceWithOptions(request: RemoveStandbyInstanceRequest, runtime: Util.RuntimeOptions): RemoveStandbyInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.forced)) {
    body['Forced'] = request.forced;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.targetInstanceId)) {
    body['TargetInstanceId'] = request.targetInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveStandbyInstance',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 备实例解耦
 *
 * @param request RemoveStandbyInstanceRequest
 * @return RemoveStandbyInstanceResponse
 */
async function removeStandbyInstance(request: RemoveStandbyInstanceRequest): RemoveStandbyInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeStandbyInstanceWithOptions(request, runtime);
}

model ResumeProjectRequest {
  id?: string(name='Id', description='This parameter is required.', example='np_4w3a****'),
}

model ResumeProjectResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: any(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='50'),
}

model ResumeProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResumeProjectResponseBody(name='body'),
}

/**
 * @summary 恢复项目
 *
 * @param request ResumeProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResumeProjectResponse
 */
async function resumeProjectWithOptions(request: ResumeProjectRequest, runtime: Util.RuntimeOptions): ResumeProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ResumeProject',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 恢复项目
 *
 * @param request ResumeProjectRequest
 * @return ResumeProjectResponse
 */
async function resumeProject(request: ResumeProjectRequest): ResumeProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return resumeProjectWithOptions(request, runtime);
}

model RetryProjectModifyRecordsRequest {
  id?: string(name='Id', description='This parameter is required.', example='344000005'),
}

model RetryProjectModifyRecordsResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='30'),
  data?: any(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='200'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model RetryProjectModifyRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RetryProjectModifyRecordsResponseBody(name='body'),
}

/**
 * @summary 根据修改记录 ID 重试修改操作（仅支持处于 FAILED 状态的修改记录）
 *
 * @param request RetryProjectModifyRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RetryProjectModifyRecordsResponse
 */
async function retryProjectModifyRecordsWithOptions(request: RetryProjectModifyRecordsRequest, runtime: Util.RuntimeOptions): RetryProjectModifyRecordsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RetryProjectModifyRecords',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据修改记录 ID 重试修改操作（仅支持处于 FAILED 状态的修改记录）
 *
 * @param request RetryProjectModifyRecordsRequest
 * @return RetryProjectModifyRecordsResponse
 */
async function retryProjectModifyRecords(request: RetryProjectModifyRecordsRequest): RetryProjectModifyRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return retryProjectModifyRecordsWithOptions(request, runtime);
}

model StartProjectRequest {
  id?: string(name='Id', description='This parameter is required.', example='np_4w3a****'),
}

model StartProjectResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: string(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='INNER_ERROR'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='XCVSADG****DSGDS'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model StartProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartProjectResponseBody(name='body'),
}

/**
 * @summary 启动项目
 *
 * @param request StartProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartProjectResponse
 */
async function startProjectWithOptions(request: StartProjectRequest, runtime: Util.RuntimeOptions): StartProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartProject',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 启动项目
 *
 * @param request StartProjectRequest
 * @return StartProjectResponse
 */
async function startProject(request: StartProjectRequest): StartProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return startProjectWithOptions(request, runtime);
}

model StartProjectsByLabelRequest {
  id?: string(name='Id', description='This parameter is required.', example='l_****'),
}

model StartProjectsByLabelResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: {
    failedProjectIds?: [ string ](name='FailedProjectIds'),
    succeedProjectIds?: [ string ](name='SucceedProjectIds'),
    total?: int32(name='Total', example='20'),
  }(name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='null'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='79'),
}

model StartProjectsByLabelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartProjectsByLabelResponseBody(name='body'),
}

/**
 * @summary 启动该label下的所有未启动项目
 *
 * @param request StartProjectsByLabelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartProjectsByLabelResponse
 */
async function startProjectsByLabelWithOptions(request: StartProjectsByLabelRequest, runtime: Util.RuntimeOptions): StartProjectsByLabelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartProjectsByLabel',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 启动该label下的所有未启动项目
 *
 * @param request StartProjectsByLabelRequest
 * @return StartProjectsByLabelResponse
 */
async function startProjectsByLabel(request: StartProjectsByLabelRequest): StartProjectsByLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  return startProjectsByLabelWithOptions(request, runtime);
}

model StopProjectRequest {
  id?: string(name='Id', description='This parameter is required.', example='np_4w3a****'),
}

model StopProjectResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='27 ms'),
  data?: string(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='INNER_ERROR'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='473469**-AA6F-4D**-B3DB-A***********'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model StopProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopProjectResponseBody(name='body'),
}

/**
 * @summary 暂停项目
 *
 * @param request StopProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopProjectResponse
 */
async function stopProjectWithOptions(request: StopProjectRequest, runtime: Util.RuntimeOptions): StopProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StopProject',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 暂停项目
 *
 * @param request StopProjectRequest
 * @return StopProjectResponse
 */
async function stopProject(request: StopProjectRequest): StopProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopProjectWithOptions(request, runtime);
}

model StopProjectModifyRecordsRequest {
  id?: string(name='Id', description='This parameter is required.', example='344000005'),
}

model StopProjectModifyRecordsResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='30'),
  data?: any(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='INNER_ERROR'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-****-****-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model StopProjectModifyRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopProjectModifyRecordsResponseBody(name='body'),
}

/**
 * @summary 根据修改记录 ID 终止修改操作，不可恢复（仅支持处于 RUNNING / FAILED 状态的修改记录）
 *
 * @param request StopProjectModifyRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopProjectModifyRecordsResponse
 */
async function stopProjectModifyRecordsWithOptions(request: StopProjectModifyRecordsRequest, runtime: Util.RuntimeOptions): StopProjectModifyRecordsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StopProjectModifyRecords',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据修改记录 ID 终止修改操作，不可恢复（仅支持处于 RUNNING / FAILED 状态的修改记录）
 *
 * @param request StopProjectModifyRecordsRequest
 * @return StopProjectModifyRecordsResponse
 */
async function stopProjectModifyRecords(request: StopProjectModifyRecordsRequest): StopProjectModifyRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopProjectModifyRecordsWithOptions(request, runtime);
}

model StopProjectsByLabelRequest {
  id?: string(name='Id', description='This parameter is required.', example='l_****'),
}

model StopProjectsByLabelResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: {
    failedProjectIds?: [ string ](name='FailedProjectIds'),
    succeedProjectIds?: [ string ](name='SucceedProjectIds'),
    total?: int32(name='Total', example='16'),
  }(name='Data'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='ERROR'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal', example='Contact the administrator.'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='A595F34C-XXXX-5D0C-8DA8-B3ED76'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='140'),
}

model StopProjectsByLabelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopProjectsByLabelResponseBody(name='body'),
}

/**
 * @summary 暂停该label下的所有运行中项目
 *
 * @param request StopProjectsByLabelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopProjectsByLabelResponse
 */
async function stopProjectsByLabelWithOptions(request: StopProjectsByLabelRequest, runtime: Util.RuntimeOptions): StopProjectsByLabelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StopProjectsByLabel',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 暂停该label下的所有运行中项目
 *
 * @param request StopProjectsByLabelRequest
 * @return StopProjectsByLabelResponse
 */
async function stopProjectsByLabel(request: StopProjectsByLabelRequest): StopProjectsByLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopProjectsByLabelWithOptions(request, runtime);
}

model SwitchoverInstanceRequest {
  forced?: boolean(name='Forced', description='Whether to force the switchover.
- true: Force the switchover.
- false: Do not force the switchover.', example='true'),
  instanceId?: string(name='InstanceId', description='The instance ID of the primary/standby instance. You can set the default value to the instance ID of the instance to be switched to the primary instance.

This parameter is required.', example='ob317v4uif****'),
  targetInstanceId?: string(name='TargetInstanceId', description='The instance ID of the instance to be switched to the primary instance.

This parameter is required.', example='ob4bv8o7sp****'),
}

model SwitchoverInstanceResponseBody = {
  data?: {
    message?: string(name='Message', description='The message of the switchover.', example='delete tag-value success'),
    success?: boolean(name='Success', description='Whether the switchover is successful.
- true: the switchover succeeded.
- false: the switchover failed.', example='true'),
  }(name='Data', description='The list of data for the switchover.'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469**-AA6F-4D**-B3DB-A***********'),
}

model SwitchoverInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SwitchoverInstanceResponseBody(name='body'),
}

/**
 * @summary You can call this operation to switch between the primary and standby instances of OceanBase.
 *
 * @param request SwitchoverInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SwitchoverInstanceResponse
 */
async function switchoverInstanceWithOptions(request: SwitchoverInstanceRequest, runtime: Util.RuntimeOptions): SwitchoverInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.forced)) {
    body['Forced'] = request.forced;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.targetInstanceId)) {
    body['TargetInstanceId'] = request.targetInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SwitchoverInstance',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to switch between the primary and standby instances of OceanBase.
 *
 * @param request SwitchoverInstanceRequest
 * @return SwitchoverInstanceResponse
 */
async function switchoverInstance(request: SwitchoverInstanceRequest): SwitchoverInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return switchoverInstanceWithOptions(request, runtime);
}

model UpdateProjectConfigRequest {
  commonTransferConfig?: {
    sinkStoreFormat?: string(name='SinkStoreFormat'),
    sourceStoreFormat?: string(name='SourceStoreFormat'),
  }(name='CommonTransferConfig'),
  fullTransferConfig?: {
    indexDDLConcurrencyLimit?: int32(name='IndexDDLConcurrencyLimit'),
    maxConcurrentIndexDDLs?: int32(name='MaxConcurrentIndexDDLs'),
    readWorkerNum?: int32(name='ReadWorkerNum', example='64'),
    throttleIOPS?: int32(name='ThrottleIOPS', example='null'),
    throttleRps?: int32(name='ThrottleRps', example='null'),
    writeWorkerNum?: int32(name='WriteWorkerNum', example='64'),
  }(name='FullTransferConfig'),
  id?: string(name='Id', description='This parameter is required.', example='np_fe****'),
  incrTransferConfig?: {
    incrSyncThreadCount?: int32(name='IncrSyncThreadCount', example='64'),
    recordTypeWhiteList?: [ string ](name='RecordTypeWhiteList'),
    supportDDLTypes?: [ string ](name='SupportDDLTypes'),
    throttleIOPS?: int32(name='ThrottleIOPS', example='null'),
    throttleRps?: int32(name='ThrottleRps', example='null'),
  }(name='IncrTransferConfig'),
  reverseIncrTransferConfig?: {
    incrSyncThreadCount?: int32(name='IncrSyncThreadCount', example='64'),
    recordTypeWhiteList?: [ string ](name='RecordTypeWhiteList'),
    supportDDLTypes?: [ string ](name='SupportDDLTypes'),
    throttleIOPS?: int32(name='ThrottleIOPS', example='null'),
    throttleRps?: int32(name='ThrottleRps', example='null'),
  }(name='ReverseIncrTransferConfig'),
}

model UpdateProjectConfigShrinkRequest {
  commonTransferConfigShrink?: string(name='CommonTransferConfig'),
  fullTransferConfigShrink?: string(name='FullTransferConfig'),
  id?: string(name='Id', description='This parameter is required.', example='np_fe****'),
  incrTransferConfigShrink?: string(name='IncrTransferConfig'),
  reverseIncrTransferConfigShrink?: string(name='ReverseIncrTransferConfig'),
}

model UpdateProjectConfigResponseBody = {
  advice?: string(name='Advice', example='Contact the administrator.'),
  code?: string(name='Code', example='INNER_ERROR'),
  cost?: string(name='Cost', example='1'),
  data?: string(name='Data', example='null'),
  errorDetail?: {
    code?: string(name='Code', example='CM-RESOAT1111'),
    extraContext?: map[string]any(name='ExtraContext'),
    level?: string(name='Level', example='WARN'),
    message?: string(name='Message', example='A system error occurred.'),
    messageMcmsContext?: map[string]string(name='MessageMcmsContext'),
    messageMcmsKey?: string(name='MessageMcmsKey', example='null'),
    proposal?: string(name='Proposal'),
    proposalMcmsContext?: map[string]string(name='ProposalMcmsContext'),
    proposalMcmsKey?: string(name='ProposalMcmsKey', example='null'),
    reason?: string(name='Reason', example='null'),
    reasonMcmsContext?: map[string]string(name='ReasonMcmsContext'),
    reasonMcmsKey?: string(name='ReasonMcmsKey', example='null'),
    upstreamErrorDetail?: any(name='UpstreamErrorDetail', example='null'),
  }(name='ErrorDetail'),
  message?: string(name='Message', example='A system error occurred.'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model UpdateProjectConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectConfigResponseBody(name='body'),
}

/**
 * @summary 更新项目配置 Action=UpdateProjectConfig
 *
 * @param tmpReq UpdateProjectConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectConfigResponse
 */
async function updateProjectConfigWithOptions(tmpReq: UpdateProjectConfigRequest, runtime: Util.RuntimeOptions): UpdateProjectConfigResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateProjectConfigShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.commonTransferConfig)) {
    request.commonTransferConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.commonTransferConfig, 'CommonTransferConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.fullTransferConfig)) {
    request.fullTransferConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.fullTransferConfig, 'FullTransferConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.incrTransferConfig)) {
    request.incrTransferConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.incrTransferConfig, 'IncrTransferConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.reverseIncrTransferConfig)) {
    request.reverseIncrTransferConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.reverseIncrTransferConfig, 'ReverseIncrTransferConfig', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.commonTransferConfigShrink)) {
    body['CommonTransferConfig'] = request.commonTransferConfigShrink;
  }
  if (!Util.isUnset(request.fullTransferConfigShrink)) {
    body['FullTransferConfig'] = request.fullTransferConfigShrink;
  }
  if (!Util.isUnset(request.id)) {
    body['Id'] = request.id;
  }
  if (!Util.isUnset(request.incrTransferConfigShrink)) {
    body['IncrTransferConfig'] = request.incrTransferConfigShrink;
  }
  if (!Util.isUnset(request.reverseIncrTransferConfigShrink)) {
    body['ReverseIncrTransferConfig'] = request.reverseIncrTransferConfigShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProjectConfig',
    version = '2019-09-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新项目配置 Action=UpdateProjectConfig
 *
 * @param request UpdateProjectConfigRequest
 * @return UpdateProjectConfigResponse
 */
async function updateProjectConfig(request: UpdateProjectConfigRequest): UpdateProjectConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateProjectConfigWithOptions(request, runtime);
}

